Pagini recente » Borderou de evaluare (job #154610) | Borderou de evaluare (job #3005612) | Cod sursa (job #484253) | Rating Viorel Popescu (ViorelPopescu) | Cod sursa (job #2373552)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("combinari.in");
ofstream fout("combinari.out");
int n, k, st[105];
void Back(int x)
{
for(int i=st[x-1]+1; i<=n; i++)
{
st[x]=i;
if(x==k)
{
for(int j=1; j<=x; j++)
fout << st[j] << ' ';
fout << '\n';
}
else
Back(x+1);
}
}
int main()
{
fin >> n >> k;
Back(1);
return 0;
}