結果

問題 No.486 3 Straight Win(3連勝)
ユーザー iwltwm
提出日時 2018-01-21 11:26:40
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 04:37:14
合計ジャッジ時間 1,515 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
char s[101];
int main(void){
	int len,i,countE=0,countW=0;
	scanf("%s",s);
	len=strlen(s);
	for(i=0;i<len;i++){
		if(s[i]=='O'){countE++;countW=0;}
		else         {countE=0;countW++;}
		if(countE==3)     {printf("East");return 0;}
		else if(countW==3){printf("West");return 0;}
	}
	printf("NA");
	return 0;
}
0