Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: vachirasawin

Problemset: Base Converter

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-14 11:45:30

// grader-chan | SU
// c2_su65_baseconv.cpp | c2_su65_baseconv

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int a, b;
    cin >> a >> b;

    stack<int> base;
    while (a > 0) {
        base.push(a % b);
        a /= b;
    }

    while (!base.empty()) {
        cout << base.top();
        base.pop();
    }

    return 0;
}