結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー goo bebes
提出日時 2024-05-14 20:06:14
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 231 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 251 ms
コンパイル使用メモリ 61,540 KB
最終ジャッジ日時 2026-05-27 11:28:12
合計ジャッジ時間 1,522 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:8:10: error: 'uint64_t' is not a member of 'std'; did you mean 'wint_t'?
    8 |     std::uint64_t temp, sum = 0;
      |          ^~~~~~~~
      |          wint_t
main.cpp:12:21: error: 'temp' was not declared in this scope; did you mean 'tm'?
   12 |         std::cin >> temp;
      |                     ^~~~
      |                     tm
main.cpp:13:9: error: 'sum' was not declared in this scope
   13 |         sum += temp;
      |         ^~~
main.cpp:15:18: error: 'sum' was not declared in this scope
   15 |     std::cout << sum;
      |                  ^~~

ソースコード

diff #
raw source code

#include <iostream>
#include <string>


int main()
{
    int a;
    std::uint64_t temp, sum = 0;
    std::cin >> a;
    
    for (int i = 0; i < a; ++i) {
        std::cin >> temp;
        sum += temp;
    }
    std::cout << sum;
}
0