Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: havename

Problemset: Base Converter

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-04 10:49:42

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    stack<int> st;
    for(int i=n;i>=1;i=i/m){
        int a=i%m;
        st.push(a);
    }
    while(!st.empty()){
        cout << st.top();
        st.pop();
    }
}