杭电 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/07/11 23:36:42
![杭电 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](/uploads/image/z/14328483-51-3.jpg?t=%E6%9D%AD%E7%94%B5+1020+%E6%97%A0%E6%B3%95AC+Problem+DescriptionGiven+a+string+containing+only+%27A%27+-+%27Z%27%2Cwe+could+encode+it+using+the+following+method%3A1.Each+sub-string+containing+k+same+characters+should+be+encoded+to+%22kX%22+where+%22X%22+is+the+only+character+in+this+sub-string)
杭电 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;