#include<stdio.h>
int a[] = { ,,,,,,,,,,,,,,,,,,, };
int result[];
int n, r;
int j = ;
void dfs(int x) {//x表示当前是第几个数
int ii;
if (x > r) {
for (ii = ; ii < r; ii++) {
printf("%3d", result[ii]);
}
printf("\n");
return;
}
for (ii = x; ii <=n-r+x; ii++) {
if (a[ii] == &&(x==||ii>result[x-])) {//每个数都必须比他的前一个数大
a[ii] = ;
result[x-] = ii;
dfs(x + );
a[ii] = ;
}
}
} int main() { scanf("%d %d", &n, &r);
dfs();
return ;
}
05-28 21:44