Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
75334 杨莹斌 十进制转二进制 C++ Accepted 1 MS 268 KB 269 2024-05-26 16:35:04

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,b[32],cnt = 0; cin >> a; if(a == 0){ cout<<"0"; } while(a != 0){ int yu = a%2; b[cnt] = yu; cnt++; a/=2; }for(int i = cnt-1;i >=0;i--){ cout<<b[i]; } return 0; }