[ create a new paste ] login | about

Link: http://codepad.org/0bmXGEgp    [ 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 i)
{
    if (i == 0) { cout << endl; return; }
    cout << i % 10;
    foo(i / 10);
}

int main()
{
    int i = 12345;
    //cin >> i;
    foo(i);
}


Output:
1
54321


Create a new paste based on this one


Comments: