Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103921 | 万隽宇 | 十进制转二进制 | C++ | Wrong Answer | 1 MS | 276 KB | 480 | 2025-01-02 19:08:25 |
#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 n,i=0; cin>>n; while(n!=0){ if(n%2==0&&i==0){ i++; n=(n-n%2)/2; } else{ cout<<n%2; n=(n-n%2)/2; } } return 0; }
------Input------
972586684
------Answer-----
111001111110000111111010111100
------Your output-----
01111010111111000011111100111