Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118872 | 陈志轩 | 行编辑程序 | C++ | 解答错误 | 0 | 0 MS | 260 KB | 364 | 2024-01-02 13:12:58 |
#include<iostream> #include<stack> using namespace std; stack <int> ans; int main(){ int n,m; cin>>n>>m; if (n == 0){ ans.push(0); } while (n > 0){ ans.push(n % m); n /= m; } while (!ans.empty()){ if (ans.top() >= 10){ putchar((char)(ans.top() - 10 + 'A')); } else{ cout<<ans.top(); } ans.pop(); } return 0; }