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

int main()
{
    cout<<"input a number:"<<endl;
    int d;
    vector<int> vec;

    cin>>d;
    while (d)
    {
        vec.push_back(d%8);
        d=d/8;
    }

    cout<<"the result is:"<<endl;
    for(vector<int>::iterator ip=vec.end()-1;ip>=vec.begin();)
    {
        cout<<*ip--;
    }
    cout<<endl;
    
    return 0;
}

 

posted on 2024-06-02 08:55  爱吃泡面的皮卡  阅读(46)  评论(0编辑  收藏  举报