Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
962 邓小龙 十进制转二进制 C++ Accepted 0 MS 268 KB 322 2023-06-10 15:02:59

Tests(20/20):


Code:

# include<iostream> using namespace std; int n; string s; int main(){ int x; char c; cin>>n; while(n!=0){ x=n%2; c=x+'0';//将数字x转化成对应数字字符 s=c+s; n=n/2; } if(s=="") cout<<'0'; else cout<<s; return 0; }