Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
70216 祝家懿 十进制转R进制 C++ Wrong Answer 1 MS 264 KB 327 2024-04-14 10:31:37

Tests(1/10):


Code:

#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[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; }


Run Info:

------Input------
0 2
------Answer-----
0
------Your output-----