Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
123408 | 黄睿杰 | 十进制转二进制 | C++ | Accepted | 1 MS | 276 KB | 249 | 2025-06-29 18:16:21 |
#include<bits/stdc++.h> using namespace std; int a[1000]; int main(){ int m; cin>>m; if(m==0) cout<<"0"; else{ int n=1; while(m!=0){ a[n]=m%2; m/=2; n++; } for(int i=n-1;i>0;i--) cout<<a[i]; } return 0; }