我的代码如下: #include <iostream.h>
int suan(unsigned int x) {
while(x!=1) {
if(x%2==0) cout<<0; else cout<<1; x=x/2;
} return x;
}
void main() { unsigned int n; int z;
cin>>n; z=suan(n); cout<<z<<endl;