提交时间:2024-04-06 09:14:14
运行 ID: 141631
#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(); }