Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162715 邓弘锐 十进制转二进制 C++ Accepted 2 MS 272 KB 280 2026-10-18 14:48:51

Tests(20/20):


Code:

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