12426 - Not Simple Unzip   

Description

After finishing the Simple ZIP program in the midterm practice, the next step is to write the unzip program to finish the whole zip/unzip project. It maybe an simple task for the safe/correct input, however your friend tell the bad news to you.In the reality, you can't always receive the safe/correct input, some input maybe the wrong format and make your program crash. Your program should handle the wrong input format.

The correct format of zip must be [integer][alpha][integer][alpha]....  

[integer] is the integer > 0

[alpha] is the set of  [a-z], [A-Z],['0','1',....'9']

[integer][alpha] is the basic zip pair unit

Take a correct format input for example : 3a3d4'1' should be unzip to aaaddd1111

Take a wrong format input for example : 5a5 should not be unzip and need to print out the error message "Can't unzip, the format is wrong!"

Note : If you are using visual studio, add #pragma warning(disable:4996) in the first line so that you can use scanf on your local machine.

Input

S_1

S_2

...

S_T

S_i :is the positive sequence ( 2 <= the size of the sequence <= 100)

T: is the number of testcase (2 <= T <= 10)

The input constraint: 

1. The input symbol will only appear [a-z], [A-Z], [0-9],['0','1',....'9']

(it mean that the testcase will not include the sequence such like "%^@$@aabb'''11'z123'")

2. The integer number in the sequence is less than 100 and greater than -1

Testcase Hint:

Testcase 1 - 4 : safe input with the correct format

testcase  5 : safe input + wrong format input (wrong order of zip pair) ex: [alpha][inter], [integer][alpha][alpha][integer]...

Testcase 6 : safe input + wrong format input (mismatch pair) ex: [inter], [alpha], [inter][alpha][inter]...

testcase  7 : safe input + wrong format input (zero integer) ex: [0][alpha], [integer][alpha][0][alpha]...

 

 

 

Output

if the input sequence can be unzip then show the unzip result in the output, otherwise show the error messge "Can't unzip, the format is wrong!" in the output.(each line followed by a newline character)

Sample Input  Download

Sample Output  Download

Tags




Discuss