結果

問題 No.486 3 Straight Win(3連勝)
ユーザー Eclair1015Eclair1015
提出日時 2018-05-25 20:58:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 64,184 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-11 03:31:50
合計ジャッジ時間 1,704 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
4,380 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:14:29: 警告: ‘east’ may be used uninitialized [-Wmaybe-uninitialized]
   14 |                         east++;
      |                         ~~~~^~
main.cpp:7:18: 備考: ‘east’ はここで定義されています
    7 |         int west,east;
      |                  ^~~~
main.cpp:16:29: 警告: ‘west’ may be used uninitialized [-Wmaybe-uninitialized]
   16 |                         west++;
      |                         ~~~~^~
main.cpp:7:13: 備考: ‘west’ はここで定義されています
    7 |         int west,east;
      |             ^~~~

ソースコード

diff #

#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;
}
0