Recursion
Recursion-01
Recursion-02
Recursion-03
~/algor $ cat problems/rekursiya-n-dan-1-gacha-chop-etish
Print from N to 1
Easy
1000 ms
64 MB
21%
You are given a positive integer $n$. Using a recursive function, print all integers from $n$ down to $1$ in descending order on one line, separated by spaces.
Do not use loops (for, while); use recursive calls.
Input
One line with one positive integer $n$ ($1 \le n \le 100$).
Output
The numbers from $n$ to $1$ in descending order, separated by spaces.
Note
$1 \le n \le 100$
Examples
Input #1
1
Output #1
1
Input #2
5
Output #2
5 4 3 2 1