Cod sursa(job #2077637)
| Utilizator | Data | 28 noiembrie 2017 12:58:22 | |
|---|---|---|---|
| Problema | Submultimi | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
// ConsoleApplication38.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("submultimi.in");
ofstream g("submultimi.out");
int main()
{
int n;
f >> n;
for (int i = 1; i < 1 << n; i++)
{
for (int j = 1; j <= n; j++)
if (i&(1 << (j - 1)))
g << j << " ";
g << '\n';
}
return 0;
}
