Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
8444 刘逸杭 十进制转R进制 C++ Accepted 0 MS 264 KB 310 2026-01-11 18:52:16

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; string d_to_r(int a,int b){ string s; while(a){ char c=a%b>9?a%b+'A'-10:a%b+'0'; s=c+s; a/=b; } if(s=="") s='0'; return s; } int main(){ int r,x; cin>>x>>r; cout<<d_to_r(x,r); return 0; }