Pagini recente » Cod sursa (job #2123781) | Cod sursa (job #2958592) | Cod sursa (job #1939275) | Cod sursa (job #1070411) | Cod sursa (job #2973907)
#include <fstream>
using namespace std;
ifstream cin("combinari.in");
ofstream cout("combinari.out");
int x[10] , n,l;
void afisare(int k)
{
for(int i = 1 ; i <= k ; ++i)
cout << x[i] << ' ';
cout << '\n';
}
void backpain(int k)
{
for(int i = x[k - 1] + 1 ; i <= n ; i++)
{
x[k] = i;
if(k==l)
afisare(k);
backpain(k + 1);
}
}
int main()
{
cin >> n>>l;
backpain(1);
return 0;
}