結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Cassian Russell-Hart
提出日時 2025-09-15 17:40:34
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 26,060 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-15 17:40:36
合計ジャッジ時間 1,753 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%d", &N);
      |     ^~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%lld", &x);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
    int N;
    scanf("%d", &N);

    long long sum = 0;
    for (int i = 0; i < N; i++) {
        long long x;
        scanf("%lld", &x);
        sum += x;
    }

    printf("%lld\n", sum);
    return 0;
}
0