Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118376 唐钧 十进制转d进制 C++ 通过 100 0 MS 256 KB 400 2023-12-30 10:29:11

Tests(10/10):


#include<bits/stdc++.h> using namespace std; stack<char>q; char num[11097]={ }; const string ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; void asd(int x,int d) { while(x/d!=0) { int sct=x%d; q.push(ch[sct]); x/=d; } if(x/d==0) { q.push(ch[x]); } } int main() { int x,d; cin>>x>>d; asd(x,d); while(!q.empty()) { cout<<q.top(); q.pop(); } return 0; }


测评信息: