#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
getchar();
while (n--)
{
int prev = getchar(), count = 1, c;
while ((c = getchar()) != '\n')
{
if (c != prev)
{
if (count == 1)
putchar(prev);
else
printf("%d%c", count, prev);
count = 1;
prev = c;
}
else
count++;
}
if (count == 1)
putchar(prev);
else
printf("%d%c", count, prev);
putchar('\n');
}
return 0;
}
ZOJ-2478
最新推荐文章于 2015-10-18 16:48:32 发布