Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
76805 sh25_wangsj 转进制 C++ 通过 0 MS 252 KB 520 2025-12-19 20:48:12

Tests(2/2):


#include <iostream> #include <cctype> using namespace std; void decToAny(int x, int m) { if (x == 0) { return; } int remainder = x % m; decToAny(x / m, m); if (remainder >= 10) { cout << (char)('A' + remainder - 10); } else { cout << remainder; } } int main() { int X, M; cin >> X >> M; if (X == 0) { cout << 0 << endl; return 0; } decToAny(X, M); cout << endl; return 0; }


测评信息: