Cod sursa(job #2077464)
Utilizator | Data | 28 noiembrie 2017 08:47:52 | |
---|---|---|---|
Problema | Submultimi | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <fstream>
using namespace std;
int n,i,j,x,d;
ifstream f("submultimi.in");
ofstream g("submultimi.out");
int main()
{
f>>n;
for (i=1;i<(1<<n);i++) {
x=i;
for (j=1;j<=n;j++) {
if (x%2==1)
g<<j<<" ";
x=x/2;
}
g<<"\n";
}
return 0;
}