Recursion
Recursion-10
Recursion-11
Recursion-12
~/algor $ cat problems/rekursiya-raqamlarni-teskari-chop-etish
Print digits in reverse
Easy
1000 ms
64 MB
29%
You are given a positive integer $n$. Using a recursive function, print the digits of this number starting from the last one (right to left) on one line, separated by spaces.
For example, for $1234$ the output must be 4 3 2 1.
Input
One line with one positive integer $n$ ($1 \le n \le 10^9$).
Output
The digits of $n$ in reverse order, separated by spaces.
Note
$1 \le n \le 10^9$
Examples
Input #1
1234
Output #1
4 3 2 1
Input #2
507
Output #2
7 0 5