题意:十进制转二进制
#include<iostream> using namespace std; int main() { int n; string s; while(cin>>n) { int i=0; while(n!=0) { s[i++]='0'+n%2; n=n/2; } i--; for(;i>=0;i--) cout<<s[i]; cout<<endl; } return 0; }