http://acm.sdut.edu.cn/judgeonline/showproblem?problem_id=2131
#include<iostream>
#include<stack>
using namespace std;
int main()
{ int a,b;
cin>>a>>b;
stack<int>s;
while(a)
{ s.push(a%b);
a=a/b;
}
while(!s.empty() )
{ cout<<s.top(); // 取栈顶;
s.pop(); //删栈顶,方便下次取栈顶
}
cout<<endl;
return 0;
}