Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118409 杨泳文 十进制转d进制 C++ 通过 100 0 MS 248 KB 453 2023-12-30 11:00:31

Tests(10/10):


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


测评信息: