-
Notifications
You must be signed in to change notification settings - Fork 6
/
chefsign.cpp
50 lines (44 loc) · 1008 Bytes
/
chefsign.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<bits/stdc++.h>
#define MAX 1000001
#define ll long long
#define DEBUG(x) do { std::cout << #x << ": " << x << " "; } while (0)
using namespace std;
int main()
{
//string str;
char str[MAX];
int i,j,k,t,less,equal,grtr,x;
int ml,me,mg;
scanf("%d",&t);
while(t--){
cin>>str;
less=ml=equal=me=grtr=mg=0;
k=1;
char ch='=';
less=1;
for(i=0;str[i]!='\0';++i){
if(str[i]!='='){
ch=str[i];
less++;
break;
}
}
for(i=i+1;str[i]!='\0';++i){
if(str[i]!='='){
if(str[i]==ch){
++less;
}
else{
ch=str[i];
if(k<less)
k=less;
less=2;
}
}
}
if(k<less)
k=less;
cout<<k<<endl;
}
return 0;
}