Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: 38408

Problemset: Base Converter

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-15 23:50:17

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin >> n >>k;
    string ans = "";
    while (n>0)
    {
        ans+=to_string(n%k);
        n/=k;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans;
    
}