Cod sursa(job #3248420)
Utilizator | Data | 11 octombrie 2024 18:45:05 | |
---|---|---|---|
Problema | Submultimi | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include <iostream>
using namespace std;
int n, v[1001], cnt;
int main()
{
cin >> n;
while (v[0] != 1)
{
int i= n;
while (v[i]==1)
{
v[i] = 0;
i--;
}
v[i] = 1;
for (int j = n; j >= 1; j--)
{
if (v[j] == 1)
{
cout << j<<' ';
}
}
cout << endl;
}
return 0;
}