| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69660 | 刘浩宇 | 十进制小数转二进制 | C++ | Wrong Answer | 1 MS | 268 KB | 279 | 2024-04-06 11:37:50 |
#include<bits/stdc++.h> using namespace std; int main(){ int x; cin>>x; if (x==0){ cout<<0; return 0; } int s=0; int a[50]={0}; for (int i=0;;i++){ a[s++]=x%2; x=x/2; if (x==0){ break; } } for (int i=s-1;i>=0;i--){ cout<<a[i]; } }
------Input------
98.69140625
------Answer-----
1100010.10110001
------Your output-----
1100010