Pagini recente » Cod sursa (job #3269434) | Cod sursa (job #3212788) | Cod sursa (job #3291116) | Borderou de evaluare (job #2332693) | Cod sursa (job #2179393)
#include <fstream>
using namespace std;
int n,i,j,x,p,cnt,a[17][65600];
ifstream fin("submultimi.in");
ofstream fout("submultimi.out");
int main(){
fin>>n;
while (v[0] == 0) {
/// construiesc codul urmator
i =n;
while (v[i] == 1) {
v[i] = 0;
i--;
}
v[i] = 1;
int ok = 0;
for (i=1;i<=n;i++)
if (v[i] == 1) {
fout<<i<<" ";
ok++;
}
if (ok == 1)
fout<<"\n";
}
return 0;
}