题意:十进制转二进制
#includeusing 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<
本文共 306 字,大约阅读时间需要 1 分钟。
题意:十进制转二进制
#includeusing 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<
转载于:https://www.cnblogs.com/lyqf/p/10235645.html