Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
94017 | 只因你太美(Ikun 真爱粉) | 十进制转二进制 | C++ | Wrong Answer | 0 MS | 276 KB | 502 | 2024-10-19 17:13:03 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a,n=0; cin>>a; string b; while(a){ if(a%2==1){ b+='1'; }else{ b+='0'; } a/=2; } for(int i=b.size()-1;i>=0;i--){ cout<<b[i]; } return 0; }
------Input------
0
------Answer-----
0
------Your output-----