zju2886

来源:互联网 发布:视频片头片尾制作软件 编辑:程序博客网 时间:2024/06/07 04:02
#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;}

原创粉丝点击