Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Chayatoeyy

Problemset: Base Converter

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-13 13:37:42

#include<bits/stdc++.h>
using namespace std;

void convert(int n,int base){
    vector<int> ans;
    while(n!=0){
        ans.push_back(n%base);
        n/=base;
    }
    for(int i=ans.size()-1;i>=0;i--){
        cout << ans[i];
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,base;
    cin >> n >> base;
    convert(n,base);
}