#t1139. 倒着数数
倒着数数
Counting Down
Problem Description
In the previous problem the loop counted from up to . This time we turn it around: count down from to .
The only thing that changes is the loop itself — start at , subtract each step, and stop when you reach :
for (int i = n; i >= 1; i--) {
// i becomes n, n-1, ..., 1 in turn
}
Read a positive integer and print the numbers from down to , one per line.
Input Format
One line containing a positive integer .
Output Format
lines; the -th line holds the -th number in descending order.
Sample Input
3
Sample Output
3
2
1
Constraints
For 100% of the test data, .
Hint: make sure the loop condition is i >= 1 and the update is i--. Get both right and counting down is done.