把2进制那题的2改成8就搞定了!
#include <iostream>
#include <vector>
using namespace std;
int main()
{
auto n = 1000000;
while (cin >> n)
{
vector<int> r(0);
while (n)
{
r.push_back(n % 8);
n /= 8;
}
for (auto i = r.rbegin(); i != r.rend(); i++)
{
cout << *i;
}
cout << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发