CSUACM :1067 1 VS 1

1067: 1 VS 1

Submit Page      Summary      Time Limit: 1 Sec       Memory Limit: 128 Mb       Submitted: 438       Solved: 294    

Description

      Alice and Bob are playing the game SanguoSha 1VS1.If Alice take a card or use a card (it may be slash,missed,peach,duel,sabotage or theft and so on) or discard (sometimes he does not need to throw any card) we will write down an uppercase 'A', if Bob does this, of course, we will write down the letter 'B'. Tell me the length of the longest operation combo performed by either player.

Input


      There are several test cases, each test case contains only a string composed of uppercaser 'A' and 'B'.The input will finish with the end of file.The length of the string is no more than 1000.

Output


     For each the case, output an integer indicate for the length.

Sample Input

AAABBAAAAA
AABBBBAA
AAAAAAAA

Sample Output

5
4
8
#include
#include
#include
using namespace std;
bool jixu(int a,int b)
{
	return a>b;   //降序 
}
int main()
{
	int a[1005],max,b;
	char s[1005];
	while(std::cin>>s)
	{
		for(int i=0;i<1005;i++)
		       a[i]=1;         //给数组赋初值 
		b=strlen(s);
		for(int i=0,j=0;i

你可能感兴趣的:(CSUACM)