結果

問題 No.191 供託金
ユーザー くれちー
提出日時 2016-08-26 00:16:35
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 244 bytes
コンパイル時間 753 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-16 22:33:39
合計ジャッジ時間 964 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%d", &c[i]);
      |                 ^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main() {
	int n, c[100], s = 0, p = 0, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &c[i]);
		s += c[i];
	}
	for (i = 0; i < n; i++) {
		if (c[i] <= s / 10) p += 30;
	}

	printf("%d\n", p);
	return 0;
}
0