题解 | #八进制#
#include <iostream>
#include <vector>
using namespace std;
vector<int> res;
int main() {
int n;
while(cin >> n){
while (n != 0) {
res.push_back( n % 8);
n /= 8;
}
for(int i = res.size() - 1; i >= 0; i --)
cout << res[i];
res.clear();
cout << endl;
}
return 0;
}


查看1道真题和解析