| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 75367 | 彭慕允 | 十进制转二进制 | C++ | Accepted | 28 MS | 272 KB | 277 | 2024-05-26 16:38:00 |
#include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; int b[32],cnt=0; if(x==0) { cout<<0; return 0; } while(x!=0) { int ys=x%2; b[cnt]=ys; cnt++; x/=2; } for(int i=cnt-1; i>=0; i--) { cout<<b[i]; } return 0; }