题意:
连续出现的字母合并
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
typedef long long ll;
char str[10005];
int main(){
int t;
cin>>t;
while(t--)
{
int cnt = 1;
cin>>str;
char c = str[0];
for(int i = 1;i <= strlen(str);i++)
{
if(str[i] != str[i-1])
{
if(cnt > 1)
cout<<cnt;
cout<<c;
cnt = 1;
c = str[i];
}
else
cnt++;
}
cout<<endl;
}
return 0;
}