杭电ACM 水题 Encoding

问题描述:

杭电ACM 水题 Encoding
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

#include#includemain(){int a;int n,i,l;char b[10001];scanf("%d",&n);while(n--){memset(b,'\0',10001);scanf("%s",b);l=strlen(b);i=0;a=1;while(i我的哪里不对了?ABBCCBBCC正确答案是A2B2C2B2C你给的答案是A4B4C他不就是这个意思吗?