網址:http://zju.acmclub.com/index.php?app=problem_title&id=1&problem_id=1330
#include<iostream> #include<stack> using namespace std; int main() { int n; while(cin>>n) { int m; stack<int> s; while(n > 0) { m = n % 8; n = n / 8; s.push(m); } while(!s.empty()) { printf("%d",s.top()); s.pop(); } printf("\n"); } return 0; }