Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
111247 邹昊辰 十进制转二进制 C++ Accepted 1 MS 268 KB 295 2025-03-01 11:12:00

Tests(20/20):


Code:

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