結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー kaito_tateyamakaito_tateyama
提出日時 2017-08-04 17:21:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 261 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 55,028 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-20 02:00:30
合計ジャッジ時間 3,976 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:13: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |         sum = sum + x;
      |         ~~~~^~~~~~~~~

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    long sum;
    int first;
    cin >> first;

    while(1){
        int x;
        cin >> x;
        sum = sum + x;
        if(cin.eof())
            break;
    }

    cout << sum << endl;
    return 0;
}
0