Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
94013 孙嘉言 十进制转二进制 C++ Accepted 1 MS 276 KB 298 2024-10-19 17:11:23

Tests(20/20):


Code:

#include <iostream> #include <cstring> #include <cmath> using namespace std; int main(){ int str,a[1001],i=0; cin>>str; if(str==0) cout<<0; while(str!=0){ a[i]=str%2; str/=2; i++; }for(int k=i-1;k>=0;k--) cout<<a[k]; return 0; }