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
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution