結果

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

ソースコード

diff #

#include <stdio.h>

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