#include <iostream>
#include <string>
using namespace std;
int main()
{
int T, j;
cin >> T;
string str;
while (T--)
{
cin >> str;
for (int i = 0; i < str.size() - 1; ++i)
{
j = i;
while (j < str.size() - 1 && str[j] == str[j + 1]) ++j;
cout << j - i + 1 << str[i];
i = j;
}
if (str[str.size() - 2] != str[str.size() - 1])
cout << 1 << str[str.size() - 1];
cout << endl;
}
return 0;
}
zju2886
最新推荐文章于 2018-08-09 09:59:44 发布