src2020/1662_pailie/main.cpp

23 lines
392 B
C++
Raw Normal View History

#include <iostream>
using namespace std;
int many, big,num[10];
void dg(int now){
if(now==big+1){
for(int i=1;i<=big;i++){
cout<<num[i];
}
cout<<endl;
return;
}
for(int i=1;i<=many;i++){
num[now]=i;
//cout<<now<<i<<endl;
dg(now+1);
}
}
int main()
{
cin >> many >> big;
dg(1);
}