Submission

Status:
PPPPPPPPPP

Score: 100

User: Angonnyyy

Problemset: Base Converter

Language: cpp

Time: 0.002 second

Submitted On: 2025-03-16 15:43:56

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

void conver(int a,int b){
    if(a<b){
        s.push(a);
        return;
    }
    int t = a%b;
    a/=b;
    s.push(t);
    conver(a,b);

}
int main(){
    int a,t,b;
    cin>>a>>b;
    conver(a,b);
    while(!s.empty()){
        cout<<s.top();
        s.pop();
    }
}