基本思想:
无;
关键点:
无;
#include<iostream> #include<string> using namespace std; void charge(int n) { string res = ""; if (n == 0) { cout << 0 << endl; return; } while (n != 0) { res = char(‘0‘ + n % 8) + res; n /= 8; } cout << res << endl; } int main() { int n; while (cin >> n) { charge(n); } }
原文:https://www.cnblogs.com/songlinxuan/p/12460038.html