输入n和k,将十进制的数n转化为k进制的数并输出
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
int main()
{
int n,k;
stack<int> s;
cin>>n>>k;
while(n)
{
s.push(n%k);
n/=k;
}
while(!s.empty())
{
cout<<s.top();
s.pop();
}
}
