| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69650 | 许铭锐 | 十进制转二进制 | C++ | Accepted | 1 MS | 268 KB | 240 | 2024-04-06 11:25:47 |
#include<bits/stdc++.h> using namespace std; int n,a[32],cnt=0; int main(){ cin>>n; if(n==0){ cout<<0; return 0; } while(n!=0){ a[cnt++]=n%2; n/=2; } for(int i=cnt-1;i>=0;i--){ cout<<a[i]; } return 0; }