Name: Dumbass 2007-06-17 19:43 ID:/qzsph9W
Modify the program so that it prints the decompressed data.
The compressed data is 1, 4, 3, 9, 5, 3, 2, 7, 0. The program currently just prints all these values except the terminating zero. When properly decompressed, the output should be:
4 9 9 9 3 3 3 3 3 7 7
Modify the program to print out the decompressed data. To do this you need to realize that the data comes in pairs like 5, 3. This first value in the pair is the number of times the second value is to be repeated. So set up a nested, inner loop to execute this number of times, and print the second value in the pair inside this inner loop.
The dumbfuck didn't give much of an explination on how to do it.
The compressed data is 1, 4, 3, 9, 5, 3, 2, 7, 0. The program currently just prints all these values except the terminating zero. When properly decompressed, the output should be:
4 9 9 9 3 3 3 3 3 7 7
Modify the program to print out the decompressed data. To do this you need to realize that the data comes in pairs like 5, 3. This first value in the pair is the number of times the second value is to be repeated. So set up a nested, inner loop to execute this number of times, and print the second value in the pair inside this inner loop.
The dumbfuck didn't give much of an explination on how to do it.