Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162458 李昱龙 十进制转R进制 C++ Accepted 2 MS 268 KB 312 2026-10-17 15:24:28

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[100]; int main(){ long long x,n,i=0; cin>>x>>n; if(x==0){ cout<<0; return 0; } while(x>0){ a[i]=x%n; x=x/n; i++; } while(i--){ if(a[i]>9){ cout<<char(a[i]+'A'-10); } else{ cout<<a[i]; } } return 0; }