Cod sursa(job #3168021)

Utilizator nicholas9onicaOnica Nicholas Andrei nicholas9onica Data 11 noiembrie 2023 13:28:58
Problema Submultimi Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int>st;
void afisare()
{
    for(int i=0;i<st.size();i++)
    {
        cout<<st[i]<<" ";
    }
    cout<<"\n";
}
void bkt(int pas)
{
    if(pas>n)
    {
        afisare();
        return;
    }
    st.push_back(pas);
    bkt(pas+1);
    st.pop_back();
    bkt(pas+1);
}
int main()
{
    cin>>n;
    bkt(1);

}