Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
323994 方相宜 【C6-2】10进制转D进制 C++ 通过 100 1 MS 260 KB 289 2025-05-24 13:33:34

Tests(5/5):


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


测评信息: