結果

問題 No.369 足し間違い
ユーザー fal_rnd
提出日時 2016-12-24 23:43:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 225 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 54,496 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 18:35:46
合計ジャッジ時間 1,107 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:22: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   14 |         cout<<sum-y<<en;
      |                      ^~

ソースコード

diff #

#include <iostream>
using namespace std;
const char en='\n';
int main(){
	cin.tie();
	ios::sync_with_stdio(false);
	int a,b,sum,y;
	cin>>a;
	for(int i=0;i<a;++i){
		cin>>b;
		sum+=b;
	}
	cin>>y;
	cout<<sum-y<<en;
	return 0;
}
0