結果
| 問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
|
| 提出日時 | 2018-07-06 20:08:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 323 bytes |
| コンパイル時間 | 405 ms |
| コンパイル使用メモリ | 56,108 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 02:52:43 |
| 合計ジャッジ時間 | 2,565 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 7 RE * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:21: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
17 | sum += a[i];
| ~~~~^~~~~~~
ソースコード
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(void) {
long long n,sum,a[50000];
cin >>n;
for(int i=0;i<n; i++ )
{
cin >>a[i];
}
for(int i=0;i<n; i++ )
{
sum += a[i];
}
cout<<sum<<endl;
return 0;
}