結果

問題 No.369 足し間違い
ユーザー fal_rndfal_rnd
提出日時 2016-12-24 23:43:03
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 225 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 50,580 KB
実行使用メモリ 4,564 KB
最終ジャッジ日時 2023-08-21 08:37:53
合計ジャッジ時間 1,020 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:15: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  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