fork download
  1. def print_numbers(n)
  2. puts n.to_s * n
  3. if n < 9
  4. print_numbers(n + 1)
  5. else
  6. return
  7. end
  8. puts n.to_s * n
  9. end
  10.  
  11. print_numbers(1)
Success #stdin #stdout 0.05s 9760KB
stdin
Standard input is empty
stdout
1
22
333
4444
55555
666666
7777777
88888888
999999999
88888888
7777777
666666
55555
4444
333
22
1