入门基础题

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n;
    while (cin >> n) { 
        string s = "";
        while (n) {
            s += '0' + n % 8;
            n /= 8;
        }
        reverse(s.begin(), s.end());
        cout << s << endl;
    }
}

while True:
    try:
        n = int(input())
        print(oct(n)[2:])
    except:
        break