結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-27 17:35:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 171 bytes |
| コンパイル時間 | 435 ms |
| コンパイル使用メモリ | 55,708 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 23:12:09 |
| 合計ジャッジ時間 | 1,152 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:9: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
16 | cout<< sum<<endl;
| ^~~
ソースコード
#include <iostream>
using namespace std;
int main()
{
int n;
int sum;
cin >> n;
for(int i = 1; i<=n; ++i )
{
sum=i+sum;
}
cout<< sum<<endl;
return 0;
}