Cod sursa(job #171196)
Utilizator | Data | 3 aprilie 2008 20:27:18 | |
---|---|---|---|
Problema | Combinari | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include<fstream.h>
int st[27],n,k;
void bkt(int l)
{
ofstream fout("pluricex.out");
int i;
if(l==k)
{
for(i=1;i<=k;i++)
fout<<st[i];
fout<<"\n";
}
else
for(i=st[l]+1;i<=n;i++)
{
st[l+1]=i;
bkt(l+1);
}
fout.close();
}
int main()
{
ifstream fin("pluricex.in");
int n,k;
fin>>n>>k;
fin.close();
bkt(0);
return 0;
}