Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: erng

Problemset: Base Converter

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-06 11:46:09

#include <bits/stdc++.h>

using namespace std;

#define ll long long

int num, base;

void baseconv(int x, int y)
{
    if (x==0) return;
    baseconv(x/y, y);

    int idx=x%y;
    if (idx<10) cout<<idx;
    else cout<<'A'+idx;
}

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>num>>base;
    baseconv(num, base);
}