Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111238 | 程余天皓 | 十进制转二进制 | C++ | Wrong Answer | 0 MS | 264 KB | 268 | 2025-03-01 11:08:32 |
#include<bits/stdc++.h> using namespace std; int x; int n=0; int a[23]; int main() { cin>>x; if(x==0){ cout<<"0"; return 0; } while(x!=0){ int y=x%2; n++; a[n]=y; x/=2; } for(int i=n-1;i>=0;i--){ cout<<a[i]; } return 0; }
------Input------
972586684
------Answer-----
111001111110000111111010111100
------Your output-----
1100103011100001111110101111000