Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147624 谢绍澜 十进制转R进制 C++ Wrong Answer 0 MS 276 KB 616 2026-02-06 15:16:12

Tests(2/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<vector> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int c(int x){ if(x>10) return x+'A'-10; else return x+'0'; } int main(){ int x,r; cin>>x>>r; vector<char>a; if(x==0){ cout<<0; return 0; } while(x){ a.push_back(c(x%r)); x/=r; } for(int i=a.size()-1;i>=0;i--){ cout<<a[i]; } return 0; }


Run Info:

------Input------
8902345 15
------Answer-----
BACAEA
------Your output-----
B:C:E: