結果

問題 No.203 ゴールデン・ウィーク(1)
コンテスト
ユーザー Haijinn
提出日時 2018-02-21 15:29:52
言語 C90
(gcc 12.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 388 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,102 ms
コンパイル使用メモリ 26,176 KB
最終ジャッジ日時 2025-12-18 10:07:54
合計ジャッジ時間 2,077 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function 'main':
main.c:12:9: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   12 |         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__;
      |              ^~~~
main.c:13:9: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   13 |         gets(s+7);
      |         ^~~~
/usr/include/stdio.h:667:14: note: declared here
  667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
main.c:17:25: error: C++ style comments are not allowed in ISO C90
   17 |                         //printf("%d\n",x);
      |                         ^
main.c:17:25: note: (this will be reported only once per input file)

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
	char s[14];
	int a;
	int d;
	int x=0;
	int n=0;
	int i;
	gets(s);
	gets(s+7);
	for(i=0;i<14;i++){
		if(s[i]=='o'){
			x++;
			//printf("%d\n",x);
			if(i==13&&n<=x){
				
				n=x;
				x=0;
				
			}
		}else {if(n<=x){
				n=x;
				//printf("!%d\n",n);
				
			}
			x=0;
		}
		
	}
	printf("%d\n",n);
	return 0;
}
0