| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 62903 | 申明智 | 十进制小数转二进制 | C++ | Compile Error | 0 MS | 0 KB | 475 | 2023-12-30 15:26:02 |
#include <bits/stdc++.h>. using namespace std; int main () { int num; cin>>num; if(num==0) return 0; int z=num; if(z==0) cout<<0; double x=num-z; int yu[32]; int len=0; while(z!=0) { yu[len++]=n%2; n/=2; } for(int i=len-1; i>=0; i--) { cout<<yu[i]; } if(x==0) { return 0; } else { cout<<"."; } for(int i=0; i<9; i++) { x*=2; int xz=x; cout<<xz; x-=xz; if(x==0) { break; } } return 0; }
Main.cc:1:25: warning: extra tokens at end of #include directive
#include .
^
Main.cc: In function 'int main()':
Main.cc:17:13: error: 'n' was not declared in this scope
yu[len++]=n%2;
^