Submission

Status:
PPPPPPPPPP

Score: 100

User: lufychop

Problemset: Base Converter

Language: cpp

Time: 0.002 second

Submitted On: 2025-03-14 14:45:37

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	stack<long long> s;
	long long n,m;
	cin>>n>>m;
	while(n!=0)
	{
		s.push(n%m);
		n=n/m;
	}
	while(!s.empty())
	{
		cout<<s.top();
		s.pop();
	}
	return 0;
}	
/*
2 3
-3 -6 -3
2 2 -3

4 3
-3 -6 -3
2 2 -3
-8 -8 -8
1 1 1
*/