結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Cassian Russell-Hart
提出日時 2025-09-20 18:38:18
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 199 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 27,084 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-20 18:38:26
合計ジャッジ時間 1,494 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:15: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
   10 |      printf("%d\n", sum);
      |              ~^     ~~~
      |               |     |
      |               int   long long int
      |              %lld
main.c:6:6: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |      scanf("%d", &N);
      |      ^~~~~~~~~~~~~~~

ソースコード

diff #

 #include <stdio.h>

int main(void) {
     int N, i;
     long long int sum;
     scanf("%d", &N);
     for (i = 1; i <= N; i++) {
         sum += i;
     }
     printf("%d\n", sum);
     return 0;
}
0