結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー projectappbird
提出日時 2019-07-24 10:07:14
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 239 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 652 ms
コンパイル使用メモリ 69,924 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-15 17:14:36
合計ジャッジ時間 1,415 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:11:9: warning: 'output' may be used uninitialized [-Wmaybe-uninitialized]
   11 |   output+=num;
      |   ~~~~~~^~~~~
main.cpp:6:16: note: 'output' was declared here
    6 |  unsigned long output;
      |                ^~~~~~

ソースコード

diff #
raw source code

#include <iostream>

int main(){
using namespace std;
 unsigned int inputNum;
 unsigned long output;
 unsigned long num;
 cin >> inputNum;
 for(unsigned int i = 1;i<=inputNum;i++){
  cin >> num;
  output+=num;
 }
 cout << output << endl;
}
0