Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: faofao
Problemset: Base Converter
Language: cpp
Time: 0.002 second
Submitted On: 2026-03-14 11:31:25
#include <bits/stdc++.h>
using namespace std;
int n,base;
int main(){
cin >> n >> base ;
string ans= "" ;
string num[] = {"0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8 " ,"9"};
while(n>0){
ans = num[n%base] + ans ;
n/=base ;
}
cout << ans ;
}