#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
const int N=1e6+9;
const double PI=acos(-1);
#define line ‘\n‘
#define gt getchar()
#define mid ((L+R)>>1)
int read(){int x=0,op=1;char c=gt;while(!isdigit(c)){if(c==‘-‘)op=-1;c=gt;}while(isdigit(c))x=x*10+c-48,c=gt;return x*op;}
string get(int x)
{
string str="";
while(x)str=char(x%2+‘0‘)+str,x/=2;
while(str.length()<5)str=‘0‘+str;
return str;
}
int main()
{
for(int i=0;i<=31;++i)cout<<get(i)<<line;
return 0;
}
原文:https://www.cnblogs.com/ZeroOne-World/p/12706235.html