Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
141606 刘嘉乐 十进制转d进制 C++ Accepted 100 0 MS 252 KB 317 2024-04-06 08:49:17

Tests(10/10):


#include<bits/stdc++.h> using namespace std; char a[1000005]; int tot = 0; int main(){ int n,d; cin>>n>>d; a[0] = '0'; string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; while(n){ a[++tot] = s[n%d]; n/=d; } int i = tot; do{ cout<<a[i]; i--; }while(i>=1); cout<<'\n'; return 0; }


Judgement Protocol: