[ create a new paste ] login | about

Link: http://codepad.org/GZFstpNE    [ raw code | output | fork ]

C++, pasted on Dec 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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);
}


Output:
1
2

30071


Create a new paste based on this one


Comments: