Toggle navigation
编绘童年
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Problem4005--周周练-第14周:递归-输出1到n
4005: 周周练-第14周:递归-输出1到n
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
41
Solved:
39
[
Status
] [
Submit
] [Creator:
]
Description
编写一个递归函数 void f(int n) 输出 1 到 n。
要求:不能使用全局变量。
Input
一个整数 n(1 ≤ n ≤ 1000)。
Output
输出 1 到 n,每个数占一行。
Sample Input
Copy
5
Sample Output
Copy
1 2 3 4 5
Source/Category
周周练-提高C