Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141581 周震东 十进制转d进制 C++ 通过 100 0 MS 260 KB 418 2024-04-06 08:36:57

Tests(10/10):


#include <bits/stdc++.h> using namespace std; stack <long long> jinzhi; int main() { int n , m; cin >> n >> m; if (n == 0) { cout << 0; } else { while (n > 0) { jinzhi.push(n % m); n /= m; } while (!jinzhi.empty()) { if (jinzhi.top() >= 10) { putchar((char)(jinzhi.top() - 10 + 'A')); } else { cout << jinzhi.top(); } jinzhi.pop(); } } return 0; }


测评信息: