文章

26

粉丝

0

获赞

111

访问

6.6k

头像
八进制 题解:
P1417 华中科技大学机试题
发布于2026年3月7日 11:50
阅读数 177

#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
using namespace std;


int main(){
    int N;
    while(cin>>N){
        string octStr;
        while(N>0){
            octStr+=N%8+'0';
            N/=8;
        }
        reverse(octStr.begin(),octStr.end());
        for(char c:octStr){
            cout<<c;
        }
        cout<<endl;
    }
    return 0;
}
 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发