結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-03-10 14:11:46 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 245 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:17:08 |
合計ジャッジ時間 | 1,042 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:11:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | fgets(s,sizeof(s),stdin); | ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <string.h>int main(void){int i;char s[100],e=0,w=0;fgets(s,sizeof(s),stdin);/*配列の中身for(i=0;i<strlen(s)-1;i++){printf("s[%d]=%c\n",i,s[i]);}*/for(i=0;i<strlen(s)-1;i++){if(s[i] == 'O'){e++;w=0;}else{e=0;w++;}if(e==3 || w==3){ break;}}if(e==3){ printf("East");}else if(w==3){ printf("West");}else printf("NA");return 0;}