题目:Encoding | JXNUOJ
描述:
Given a string containing only 'A' - 'Z', we could encode it using the following method:
给定一个仅包含'A' - 'Z'的字符串,我们能够使用以下方法编码它。
1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.
1.每个 包括k个相同的字符 的子字符串 应该被编码为 "kX","X"是指在这个子字符串中唯一的字符。
2. If the length of the sub-string is 1, '1' should be ignored.
2.如果子字符串的长度是1,1应该被忽略。
输入:
The first line contains an integer N (1 <= N <= 100) which indicates the number of test cases. The next N lines contain N strings. Each string consists of only 'A' - 'Z' and the length is less than 10000.
第一行包括一个整数N(1 <= N <= 100)表示测试组数。接下来的N行包括N个字符串。每个字符串仅包括'A' - 'Z',且长度小于10000.
输出:
For each test case, output the encoded string in a line.
对于每组数据,单行输出编码的字符串。
词汇:
encode 编码