P20051 [GeeksforGeeks] Print n to 1 without loop
普及-
题目描述

Print numbers from N to 1 (space separated) without the help of loops.
Example 1:
Input:
N = 10
Output: 10 9 8 7 6 5 4 3 2 1
Your Task:
This is a function problem. You only need to complete the function printNos() that takes N as parameter and prints number from N to 1 recursively. Don't print newline, it will be added by the driver code.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N) (Recursive).
Constraint
1<=n<=1000

输入格式

见题面

输出格式

见题面

样例输入
N = 10
样例输出
10 9 8 7 6 5 4 3 2 1