Cod sursa(job #2545301)
| Utilizator | Data | 12 februarie 2020 23:09:00 | |
|---|---|---|---|
| Problema | Submultimi | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("submultimi.in");
ofstream fout("submultimi.out");
int a[20],n;
void Afisare()
{
for (int i=1; i<=n; i++)
if (a[i]==0) fout << i << " ";
fout << "\n";
}
void Back(int top)
{
if (top==n+1) Afisare();
else for (int i=0; i<=1; i++)
{
a[top]=i;
Back(top+1);
}
}
int main()
{
fin >> n;
Back(1);
return 0;
}
