Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54652 | zhangweiran | 转进制 | C++ | Accepted | 0 MS | 244 KB | 248 | 2024-10-30 17:42:05 |
#include<bits/stdc++.h> using namespace std; string b="ABCDEF"; int m; void f(int x){ int d=x%m; if(x==0) return; f(x/m); if(d<10){ cout<<d; }else{ cout<<b[d-10]; } } int main(){ int n; cin>>n>>m; f(n); return 0; }