結果

問題 No.8020 サンシャイン◯崎
ユーザー sawa_tsuka
提出日時 2017-03-31 23:42:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 55,836 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 14:03:17
合計ジャッジ時間 1,162 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:13: warning: ‘y[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |         y[3]+=(str[i]=='H');
      |         ~~~~^~~~~~~~~~~~~~~
main.cpp:9:13: warning: ‘y[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    9 |         y[0]+=(str[i]=='Y');
      |         ~~~~^~~~~~~~~~~~~~~
main.cpp:13:13: warning: ‘y[4]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |         y[4]+=(str[i]=='!');
      |         ~~~~^~~~~~~~~~~~~~~
main.cpp:10:13: warning: ‘y[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   10 |         y[1]+=(str[i]=='E');
      |         ~~~~^~~~~~~~~~~~~~~
main.cpp:11:13: warning: ‘y[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   11 |         y[2]+=(str[i]=='A');
      |         ~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main(){
    int y[5];
    string str;
    cin>>str;
    for(int i=0;i<str.length();i++){
        y[0]+=(str[i]=='Y');
        y[1]+=(str[i]=='E');
        y[2]+=(str[i]=='A');
        y[3]+=(str[i]=='H');
        y[4]+=(str[i]=='!');
    }
    printf("%d %d %d %d %d",y[0],y[1],y[2],y[3],y[4]);
    return 0;
}
0