Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141603 | 刘嘉乐 | 十进制转d进制 | C++ | 解答错误 | 80 | 0 MS | 252 KB | 289 | 2024-04-06 08:47:01 |
#include<bits/stdc++.h> using namespace std; char a[1000005]; int tot = 0; int main(){ int n,d; cin>>n>>d; string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; while(n){ a[++tot] = s[n%d]; n/=d; } for(int i=tot;i>=1;i--){ cout<<a[i]; } cout<<'\n'; return 0; }