Cod sursa(job #376707)

Utilizator victor.ionescuIonescu Victor Cristian victor.ionescu Data 22 decembrie 2009 12:40:44
Problema Submultimi Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.25 kb
#include <fstream>
using namespace std;
ifstream fi("submultimi.in");
ofstream fo("submultimi.out");

int main(){
	int N;
	fi>>N;
	for (int i=1;i<(1<<N);++i){
		for (int j=0;j<N;++j) if (i & (1<<j)) fo<<j+1<<" ";
		fo<<"\n";
	}
	fo.close();
	return 0;
}