Outer loop goes over the lines. On each line it executes the inner loop.
The inner loop prints as many numbers. On first line it prints one number. On second it prints two. On third ...
The numbers to print ... what if you had number 6 (no, not the http://en.wikipedia.org/wiki/The_Prisoner ) and deduct from it 1 if you should print first number, 2 if you should print second number, ...
In which case, I would suggest that you use a string and loop from 5 to 0 appending the value of your iterator on each iteratoin and writing the content of the string variable to cout.