[ create a new paste ] login | about

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

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

def print1toN(n)
  print1toN(n-1) if n > 1
  print n
end

print1toN(5)


Output:
1
12345


Create a new paste based on this one


Comments: