結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2017-07-28 22:36:48 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 37,256 KB |
| 最終ジャッジ日時 | 2026-02-24 00:50:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
コンパイルメッセージ
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/ccIVaDpq.o: in function `main':
main.c:(.text.startup+0x9): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#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");
x++;
break;
}else if(s[i]=='X'&&s[i+1]=='X'&&s[i+2]=='X'){
printf("West\n");
x++;
break;
}
}
if(x==0){
printf("NA\n");
}
return 0;
}
Haijinn