Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
323565 黄浙峰老师 【C6-2】10进制转D进制 C++ 通过 100 1 MS 256 KB 279 2025-05-18 14:08:32

Tests(5/5):


#include <bits/stdc++.h> using namespace std; int main(){ int n,d,t; cin>>n>>d; if(n==0){ cout<<0; return 0; } string s=""; while(n>0){ t=n%d; if(t>9){ s=char(t-10+'A')+s; }else{ s=char(t+'0')+s; } n=n/d; } cout<<s; return 0; }


测评信息: