65,187
社区成员




#include <iostream>
using namespace std;
int main()
{
int i;
int array[32];
cin >> i;
for (int j = 31; j != -1; --j)
{
array[j] = i & 1;
i = i >> 1;
}
j = 0;
while(array[j] == 0)
{
++j;
}
for ( ; j!= 32; ++j)
{
cout << array[j];
}
cout << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a=0;
int i=0;
int j=0;
int stack[1024] = {0};
int count = 0;
cin >> a;
while (a !=0)
{
i = a/2;
j = a%2;
a = a/2;
count ++;
stack[count-1] = j;
}
while(count!=0)
{
cout << stack[count-1];
count--;
}
return 0;
}
#include <iostream>
#include <bitset>
using namespace std;
int main(void)
{
int n;
bitset<32> nb;
cin>>n;
nb=n;
cout<<nb<<endl;
system("pause");
return 0;
}