Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162665 李沐阳 十进制转二进制 C++ Accepted 1 MS 272 KB 255 2026-10-18 10:29:53

Tests(20/20):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int q; cin>>q; int s[33]={},i=0; if(q==0){ cout<<0<<endl; return 0; } while(q!=0){ s[i]+=q%2; q/=2; i++; } for(int j=i-1;j>=0;j--){ cout<<s[j]; } return 0; }