大会员可查看代码,点此开通大会员
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
printf("000000\n");
printf("000001\n");
int n = 2;
string s = "000001";
while (s != "111111")
{
int tmp = n;
int index = 5;
while (tmp != 0)
{
if (tmp % 2 == 0)
{
s[index--] = '0';
}
else
{
s[index--] = '1';
}
tmp /= 2;
}
cout << s << endl;
n++;
}
}