Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141580 吴晨曦 十进制转d进制 C++ 解答错误 80 0 MS 252 KB 429 2024-04-06 08:36:40

Tests(8/10):


#include <bits/stdc++.h> using namespace std; 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; } while (stk.size()) cout << stk.top(), stk.pop(); return 0; }


测评信息: