CCCPaste

Untitled

#include 
#include 
using namespace std;
int n;


int main()
{
    cin >> n;
    int power = 1;
    for(int i = 1; i <= n; i++) {
        power *= 2;
    }
    int pows_of_two = 0;
    for(int i = 0; i < power; i++) {
        pows_of_two = 1;
        cout << "{";
        for(int j = 0; j < n; j++) {
            if(i & pows_of_two) {
                cout << j + 1 << " " ;
            }
            pows_of_two *= 2;
        }
        cout << "}" << endl;
    }
    return 0;
}