結果

問題 No.369 足し間違い
ユーザー Maeda
提出日時 2025-03-07 16:15:53
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 24,704 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2025-03-07 16:15:55
合計ジャッジ時間 1,185 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d\n",&numCount);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |                 scanf("%d",&num);
      |                 ^~~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d",&yukiAns);
      |         ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
	int numCount = 0 , num = 0 , ans = 0, yukiAns = 0;
	scanf("%d\n",&numCount);
	for(int i = 0 ; i < numCount ; i++){
		scanf("%d",&num);
		ans += num;
	}
	scanf("%d",&yukiAns);
	printf("%d",ans - yukiAns);
}
0