#include <iostream>
void change(int decimal, int number)
{
if (number < 0)
{
number = abs(number);
}
if (number) {
change(decimal, number / decimal);
std::cout << number % decimal;
}
}
int main()
{
//几进制
int decimal;
//需要转换的数
int number;
input:
std::cout << "请输入要转换的进制:" << std::endl;
std::cin >> decimal;
std::cout << "请输入要转换的数字:" << std::endl;
std::cin >> number;
change(decimal, number);
std::cout << std::endl;
goto input;
}