八进制 题解:C++实现
	
#include<bits/stdc++.h>
using namespace std;
int main( ){
    int s;
    while(cin >> s){
        char ans[999999];
        int cnt = 0;
        while(s != 0){
            ans[cnt ++] = (s % 8) + '0';
            s /= 8;
        }
        for(int i = cnt -1 ;i >= 0 ;i --){
            cout << ans[i];
        cout << endl;
        }
    }
    return 0;
}
 
    
        
        
        
 
    
        
        
登录后发布评论
暂无评论,来抢沙发