Cod sursa(job #1085722)
| Utilizator | Data | 17 ianuarie 2014 12:15:44 | |
|---|---|---|---|
| Problema | Combinari | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <fstream>
using namespace std;
ifstream fin("combinari.in");
ofstream fout("combinari.out");
short int N,K,Vector[19];
inline void Combinari(short int c)
{
if(c==K+1)
{
for(short int i=1; i<=K; i++)
fout<<Vector[i]<<' ';
fout<<'\n';
}
else for(Vector[c]=Vector[c-1]+1; Vector[c]<=N; Vector[c]++)
Combinari(c+1);
}
int main()
{
fin>>N>>K;
Combinari(1);
}
