| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70215 | 祝家懿 | 十进制转R进制 | C++ | Compile Error | 0 MS | 0 KB | 327 | 2024-04-14 10:31:06 |
#include<bits/stdc++.h> using namespace std; int x,r; int a[35]; int cnt=0; int main(){ cin>>x>>r; while(x!=0){ a[ant++]=x%r; x/=r; } for(int i=cnt-1;i>=0;i--){ if(a[i]<10){ cout<<a[i]; } else if(a[i]==10){ cout<<"A"; } else if(a[i]==11){ cout<<"B"; } } return 0; }
Main.cc: In function 'int main()':
Main.cc:9:5: error: 'ant' was not declared in this scope
a[ant++]=x%r;
^