Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141605 刘嘉乐 十进制转d进制 C++ 解答错误 80 0 MS 248 KB 303 2024-04-06 08:48:23

Tests(8/10):


#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; } int i = tot; do{ cout<<a[i]; i--; }while(i>=1); cout<<'\n'; return 0; }


测评信息: