結果

問題 No.3020 サンシャイン◯崎
ユーザー okkuukenkenokkuukenken
提出日時 2022-06-03 22:05:29
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 731 ms
コンパイル使用メモリ 78,016 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 01:53:21
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:47: warning: 'ex' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
      |                                               ^~
main.cpp:7:21: note: 'ex' was declared here
    7 |         int y,e,a,h,ex;
      |                     ^~
main.cpp:20:42: warning: 'h' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
      |                                          ^~~
main.cpp:7:19: note: 'h' was declared here
    7 |         int y,e,a,h,ex;
      |                   ^
main.cpp:20:34: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
      |                                  ^~~
main.cpp:7:17: note: 'a' was declared here
    7 |         int y,e,a,h,ex;
      |                 ^
main.cpp:20:26: warning: 'e' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
      |                          ^~~
main.cpp:7:15: note: 'e' was declared here
    7 |         int y,e,a,h,ex;
      |               ^
main.cpp:20:18: warning: 'y' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
      |                  ^~~
main.cpp:7:13: note: 'y' was declared here
    7 |         int y,e,a,h,ex;
      |             ^

ソースコード

diff #

#include<iostream>
#include<string>
using namespace std;
int main(){
	string s;
	cin>>s;
	int y,e,a,h,ex;
	for(auto x:s){
		if(x=='Y')
			y++;
		if(x=='E')
			e++;
		if(x=='A')
			a++;
		if(x=='H')
			h++;
		if(x=='!')
			ex++;
	}
	cout<<y<<' '<<e<<' '<<a<<' '<<h<<' '<<ex<<endl;
}
0