//简单题 当该数不为0时 只需对进制不断取余 并除进制, 就可以得到该进制数
#include <cstdio>
#include <vector>
using namespace std;
void convert(int number,int n) {
vector<int> vec;
if (number == 0) {
vec.push_back(0);
}
else {
while (number != 0) {
vec.push_back(number % n);
number /= n;
}
}
for (int i = vec.size() - 1; i >= 0; i--) {
printf("%d", vec[i]);
}
printf("\n");
}
int main() {
int n;
while (scanf("%d", &n) != EOF) {
convert(n,8);
}
return 0;
}

京公网安备 11010502036488号