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