[ create a new paste ] login | about

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

kabhwan - Ruby, pasted on Apr 7:
1
2
3
4
5
6
7
8
9
10
11
12
# C/C++로 배우는 자료구조론 연습문제 4.15

def PrintDecimalReverse(n)
  if n == 0
    puts
  else
    print n % 10
    PrintDecimalReverse(n / 10)
  end
end

PrintDecimalReverse(12345)


Output:
1
54321


Create a new paste based on this one


Comments: