29. Count Down From N
Foundation1000 ms256 MBSolved by 0%
Read an integer n and print every number from n down to 1,
separated by single spaces, on one line.
There must be no trailing space after the final number.
Constraints - `1 ≤ n ≤ 100000`
Input
A single line containing one integer n.
Output
Print the numbers from n down to 1 on ONE line, separated by single spaces. No trailing space after the last number.
Input5
Output5 4 3 2 1
Noteis a small countdown
Input1
Output1
Noteis a single number with no space at all
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.