http://acm.hdu.edu.cn/showproblem.php?pid=1020
#include<stdio.h>
const int MAX = 10008;
char s[MAX];
int main()
{
int T;
scanf("%d", &T);
while(T--)
{
int count = 1, i;
scanf("%s", s);
for(i=0; s[i]; ++i)
{
if(s[i] == s[i+1])
{
count++;
}
else
{
if(count != 1)
printf("%d", count);
printf("%c", s[i]);
......
阅读全文