提交时间:2024-12-12 16:47:44

运行 ID: 58529

#include<iostream> using namespace std; char num[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; void turn(int n,int k){ if(n>=k){ turn(n/k,k); } cout<<num[n%k]; } int main() { int x,m; cin>>x>>m; turn(x,m); return 0; }