Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141647 | 谭子浩 | 十进制转d进制 | C++ | 通过 | 100 | 0 MS | 260 KB | 426 | 2024-04-06 09:25:58 |
#include<bits/stdc++.h> using namespace std; #define I am jvruo stack<char>stk; char a[37]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int main() { int n,d; cin>>n>>d; while(n) { stk.push(a[n%d]); n/=d; } if(stk.empty()) cout<<0<<endl; while(!stk.empty()) { cout<<stk.top(),stk.pop(); } }