杭电 1020 无法AC Problem DescriptionGiven a string containing only 'A' - 'Z',we could encode it using the following method:1.Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 19:00:11
杭电 1020 无法AC Problem DescriptionGiven a string containing only 'A' - 'Z',we could encode it using the following method:1.Each sub-string containing k same characters should be encoded to

杭电 1020 无法AC Problem DescriptionGiven a string containing only 'A' - 'Z',we could encode it using the following method:1.Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string
杭电 1020 无法AC
Problem Description
Given a string containing only 'A' - 'Z',we could encode it using the following method:
1.Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.
2.If the length of the sub-string is 1,'1' should be ignored.
Input
The first line contains an integer N (1 n;
\x05while(n--)
\x05{
\x05\x05t=0;
\x05\x05t1=0;
\x05\x05i=0;
\x05\x05gets(a);
\x05\x05while(a[i]!=NULL)
\x05\x05{
\x05\x05\x05count=1;
\x05\x05\x05while(a[i]==a[i+1])
\x05\x05\x05{
\x05\x05\x05\x05count++;
\x05\x05\x05\x05i++;
\x05\x05\x05}
\x05\x05\x05
\x05\x05\x05if(count==1)
\x05\x05\x05\x05cout

杭电 1020 无法AC Problem DescriptionGiven a string containing only 'A' - 'Z',we could encode it using the following method:1.Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string
把 gets(a) 换成 cin >> a;