/*
qq:1239198605
ctgu_yyf
*/
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
using namespace std;
int n,r;
int a[105];
void dfs(int n,int sum)
{
if(sum==r)
{
for(int j=0;j<sum;j++)
cout<<a[j];
cout<<endl;
return ;
}
for(int i=n;i>=1;i--)
{
a[sum]=i;
dfs(i-1,sum+1);
}
}
int main()
{
cin>>n>>r;
dfs(n,0);
return 0;
}
02-27
9984
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)