結果
問題 |
No.369 足し間違い
|
ユーザー |
![]() |
提出日時 | 2017-01-13 23:07:19 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 181 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 20,224 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-21 12:06:16 |
合計ジャッジ時間 | 650 ms |
ジャッジサーバーID (参考情報) |
judge4 / 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); | ^~~~~~~~~~~~~~ main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&a); | ^~~~~~~~~~~~~~ main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&b); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { int i,ans=0,n,a,b; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&a); ans += a; } scanf("%d",&b); printf("%d\n",ans-b); return 0; }