結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー startcppstartcpp
提出日時 2015-05-08 23:26:11
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 563 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 66,868 KB
最終ジャッジ日時 2023-08-11 15:37:36
合計ジャッジ時間 899 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(strstr(str, maru) != '\0') {
                           ^~~~

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;

char buf[8], str[15];
int main() {
	cin >> buf;
	strcpy(str, buf);
	cin >> buf;
	strcat(str, buf);

	for(int i = 14; i > 0; i--) {
		char maru[15];
		for(int j = 0; j < i; j++) maru[j] = 'o';
		maru[i] = '\0';
		if(strstr(str, maru) != '\0') {
			cout << i << endl;
			return 0;
		}
	}
	cout << 0 << endl;
	return 0;
}
0