题解 | #八进制#
八进制
http://www.nowcoder.com/practice/eda051c1effc4dffa630bc8507f0c5f7
十进制转任何进制格式
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
while (cin >> n) {
vector<int> res;
while (n != 0) {
res.push_back(n % 8);
n = n / 8;
}
for (int i = res.size() - 1; i >= 0; i--) {
cout << res[i];
}
cout << endl;
}
return 0;
}