| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 75459 | 彭慕允 | 十进制转R进制 | C++ | Compile Error | 0 MS | 0 KB | 538 | 2024-05-26 18:11:43 |
#include<bits/stdc++.h> using namespace std; int main() { double n; cin>>n; int z=n; double x=n-z; int b[32],cnt=0; while(z!=0) { int yu=z%2; b[cnt]=yu; cnt++; z/=2; } if(cnt==0) { cout<<0; } else { for(int i=cnt-1; i>=0; i--) { cout<<b[i]; } } if(x!= 0) { cout<<"."; } else { return 0; } for(int i=0; i<9; i++) { x=x*r; int xz=x; if(xz<10) { cout<<xz } else { xz+=55; cout<<(char)xz; } x=x-xz; if(x==0) { break; } } return 0; }
Main.cc: In function 'int main()':
Main.cc:29:7: error: 'r' was not declared in this scope
x=x*r;
^
Main.cc:33:3: error: expected ';' before '}' token
} else {
^