結果

問題 No.369 足し間違い
ユーザー mosmos_21mosmos_21
提出日時 2016-10-14 19:02:29
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 19,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 23:02:12
合計ジャッジ時間 547 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%d", &n);
      |   ^~~~~~~~~~~~~~~
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d", &a);
      |     ^~~~~~~~~~~~~~~
main.c:11:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%d", &v);
      |   ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
  int n, s = 0, v, i, a;

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &a);
    s += a;
  }
  scanf("%d", &v);
  printf("%d", v - a);
  return 0;
}
0