By Neilor Tonin, URI Brazil
Francisco is a teacher and need your help to compress some text files. As the files contain basically white spaces and zeros (0), this program must be something very simple. The text contains only uppercase and lowercase letters, spaces and numbers. You must to consider the $ like a symbol for compression of spaces and the symbol # like a symbol to compress zeros. Remember 2 details:
To understand a little more, consider the following ASCII table: for example, CHR(3) means “ETX”
Note:
The input contains many test cases. Each test case contains a number N that indicates the number of test cases. Each test case contains up to 2000 chars.
Each input line must produce a output line, that is the compressed input, like example above
Sample Input | Sample Output |
3 |
124##2342340234Movimento |