Encoding binary numbers
A binary number can be encoded into decimal digits by the following counting method.
|
Binary number |
Counting |
Decimal digits |
|
000 |
3x0 |
30 |
|
0111 |
1x0 3x1 |
1031 |
|
111000001 |
3x1 5x0 1x1 |
315011 |
|
1010 |
1x1 1x0 1x1 1x0 |
11101110 |
Технічні умови
Input
The input includes lines of a character string representing a binary number. The length of a binary number in each line is between 1 and 100 inclusive. The line containing only zero (0) indicates the end of the input. The last line must not be encoded into decimal digits. The input may contain up to 1000 lines.
Output
Print out in each line the decimal digits corresponding to the binary number. There is no space between digits.
Інформація про задачу
Ліміт часу: 1 секундаЛіміт пам`яті: 64 MB
Бали за пройдений тест: 5
Приклад
Приклад вхідних даних111100000011 000 01010101 11 0 |
Приклад вихідних даних416021 30 1011101110111011 21 |
| ← Elephant show | Список задач | Chorus → |
