Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
79631 hby 十进制转二进制 C++ Accepted 1 MS 272 KB 254 2024-07-09 10:36:31

Tests(20/20):


Code:

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