#include <iostream>
#include <stack>
using namespace std ;
int main()
{
int n ,k ;
stack<int> stk;
cin >> n >> k ;
if(n==0)
{
cout << 0 ;
return 0 ;
}
while(n)
{
stk.pusk(n%k);
n/=k;
}
while(!stk.empty())
{
cout << stk.top();
stk.pop();
}
return 0 ;
}
十进制转换为k进制
最新推荐文章于 2024-04-24 16:57:12 发布