Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141631 | | 十进制转d进制 | C++ | 解答错误 | 70 | 0 MS | 252 KB | 393 | 2024-04-06 09:14:14 |
#include <bits/stdc++.h> using namespace std; char a[37]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; stack <char>n; int main(){ int k,d; cin>>k>>d; while(k){ n.push(a[k%d]); k/=d; } if(!n.size()) { cout<<'0'<<endl;return 0; } while(n.size()) cout<<n.top(),n.pop(); }