結果

問題 No.486 3 Straight Win(3連勝)
コンテスト
ユーザー Haijinn
提出日時 2017-07-28 22:35:47
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 352 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 158 ms
コンパイル使用メモリ 37,404 KB
最終ジャッジ日時 2026-02-24 00:49:58
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:9:1: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    9 | gets(s);
      | ^~~~
In file included from main.c:1:
/usr/include/stdio.h:667:14: note: declared here
  667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
/usr/bin/ld: /tmp/ccaKLU2m.o: in function `main':
main.c:(.text.startup+0x9): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include<stdio.h>
#include<string.h>


int main(){
char s[101];
int i;
int x=0;
gets(s);
for(i=0;i<strlen(s);i++){
	if(s[i]=='O'&&s[i+1]=='O'&&s[i+2]=='O'){
		
		printf("East\n");
		break;
		x++;
		
		
	}else if(s[i]=='X'&&s[i+1]=='X'&&s[i+2]=='X'){
		printf("West\n");
		break;
		x++;
		
	}
	
	
	
	
	
	
}
if(x==0){
	
	printf("NA\n");
	
}

	return 0;
}
0