题解 | #八进制#
八进制
http://www.nowcoder.com/practice/eda051c1effc4dffa630bc8507f0c5f7
//栈的实现
#include <iostream>
#include <stack>using namespace std;
int main()
{
int n;
while(cin>>n){
if(n==0){
cout<<0<<endl;
}
stack<int> s;
while(n!=0){
s.push(n%8);
n/=8;
}
while(!s.empty()){
cout<<s.top();
s.pop();
}
cout<<endl;
}
return 0;
}