Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
150135 | fangbaoqinfhgj | K进制数转L进制数 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 266 | 2024-06-01 15:51:30 |
#include <bits/stdc++.h> using namespace std; string sh(int x,int n){ const string a="0123456789ABCDEF"; string s=""; if(x==0) retrurn "0"; for(;x>0;x/=n) s=a[x%n]+s; return s; } int main(){ int x,n; cin>>x>>n; cout<<sh(x,n)<<endl; return 0; }