Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111243 | 王思颜 | 十进制转二进制 | C++ | Accepted | 1 MS | 272 KB | 287 | 2025-03-01 11:08:39 |
#include<bits/stdc++.h> using namespace std; int a; int main() { cin>>a; int x[32],j = 0; if (a == 0){ cout<<0; return 0; } while(a != 0){ int yu = a % 2; x[j] = yu; j++; a = a / 2; } for (int i = j - 1;i >= 0;i--){ cout<<x[i]; } return 0; }