| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70217 | 祝家懿 | 十进制转R进制 | C++ | Wrong Answer | 1 MS | 272 KB | 370 | 2024-04-14 10:32:26 |
#include<bits/stdc++.h> using namespace std; int x,r; int a[35]; int cnt=0; int main(){ cin>>x>>r; if(x==0){ cout<<'0'; return 0; } while(x!=0){ a[cnt++]=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; }
------Input------
8902345 15
------Answer-----
BACAEA
------Your output-----
BAAA