Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118885 毛泓博(做题专用,大号Fess) 十进制转d进制 C++ 通过 100 0 MS 244 KB 341 2024-01-02 13:17:48

Tests(10/10):


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


测评信息: