結果

問題 No.341 沈黙の期間
ユーザー kongarishisyamo
提出日時 2016-02-24 01:01:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 54,624 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 13:15:29
合計ジャッジ時間 1,031 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 3 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:13:16: warning: multi-character character constant [-Wmultichar]
   13 |         sample='…';
      |                ^~~
main.cpp: In function ‘int main()’:
main.cpp:13:16: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘14844070’ to ‘'\37777777646'’ [-Woverflow]

ソースコード

diff #

#include<iostream>
#include<cstring>

using namespace std;

int main(){

	char s;
	int ans=0;
	int c=0;
	char sample;

	sample='…';
	cin>>s;

	while(cin>>s){
		if(s=='\n') break;
		if(s==sample){
			c++;
			if(!(cin>>s)) break;
		}
		else{
			if(c>ans) ans=c;
			c=0;
		}
	}
	if(c>ans) ans=c;
	cout<<ans<<endl;

}
0