#include <iostream>
using namespace std;
void foo(int n, int base)
{
if (n == 0) { cout << endl; return; }
foo(n / base, base);
cout << n % base;
}
int main()
{
int i = 12345;
//cin >> i;
foo(i, 8);
}
http://codepad.org/GZFstpNE
30071
如果回答满意请及时采纳,方法是点我回答右边的采纳按钮,谢谢。