結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
![]() |
提出日時 | 2018-05-25 20:58:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 351 bytes |
コンパイル時間 | 481 ms |
コンパイル使用メモリ | 64,384 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 18:05:25 |
合計ジャッジ時間 | 1,221 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 20 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:14:29: warning: 'east' may be used uninitialized [-Wmaybe-uninitialized] 14 | east++; | ~~~~^~ main.cpp:7:18: note: 'east' was declared here 7 | int west,east; | ^~~~ main.cpp:16:29: warning: 'west' may be used uninitialized [-Wmaybe-uninitialized] 16 | west++; | ~~~~^~ main.cpp:7:13: note: 'west' was declared here 7 | int west,east; | ^~~~
ソースコード
#include<iostream> #include<string.h> using namespace std; int main(){ char c[101]; int a; int west,east; cin>>c; a=strlen(c); for(int i=0;i<a;i++){ if(c[i]=='O'){ east++; }else if(c[i]=='X'){ west++; } if(east==3){ cout<<"East"<<endl; break; }else if(west==3){ cout<<"West"<<endl; break; } } return 0; }