結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー sasa
提出日時 2025-03-12 17:57:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 286 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 27,648 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-12 17:57:08
合計ジャッジ時間 1,813 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:25: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
    8 |                 scanf("%s",str);
      |                        ~^  ~~~
      |                         |  |
      |                         |  int*
      |                         char*
      |                        %d
main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%s",str);
      |                 ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	int str[7];
	int max = 0;
	int count = 0;
	for(int i = 0;i < 2;i++){
		scanf("%s",str);
		for(int j = 0;j < 7;j++){
			if(str[i] == 'x'){
				count = 0;
				if(count > max){
					max = count;
				}
			}else{
				count++;
			}
		}
	}
	printf("%d",max);
}
0