MAIN Home Schedule Rules Compile RESULTS Results PROBLEMS Novice Veteran All |
Consider the string AAAABCCCCCDDDD consisting of alphabetic characters only. This string is of length 14. Since the string consists of alphabetic characters only, duplicate characters can be removed and replaced with a duplication factor n. With this technique the string can be compressed and represented by 4AB5C4D. The compressed string is of length 7. Write a program which takes a string in compressed form and recreates the original uncompressed string.
InputInput will be a series of lines with one string per line. There will be only uppercase letters and digits in the string. All digits are compression counts. There will never be two digits in a row. You stop reading lines when you read a line with only a # on it. No input line will be longer than 50 characters.
OutputYou are to output one line for each line of input. The output should be the uncompressed version of the input line.
Sample Input
3A4B7D 2D7AC8FGD 2ABCDE #
Sample Output
AAABBBBDDDDDDD DDAAAAAAACFFFFFFFFGD AABCDE
|
This page last updated 2001/04/05 20:28:51.