[ create a new paste ] login | about

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

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

def WriteBackward(str_array, array_size)
  return if array_size < 1

  print str_array[array_size - 1]
  WriteBackward(str_array, array_size - 1)
end

WriteBackward(['A', 'B', 'C', 'D', 'E'], 5)


Output:
1
EDCBA


Create a new paste based on this one


Comments: