1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
答案
#include <iostream>
using namespace std;
void print(int a[], int n) {
if (n > 0) {
printf(a, n - 1);
for (int i = 0;i < n;i++) {
cout << a[i] << " ";
}
cout << "\n";
}
}
int main() {
int a[] = { 1,2,3,4,5,6,7,8,9,10 };
printf(a, 10);
return 0;
}