fork download
  1. def fib()
  2. t1 = 1
  3. t2 = 1
  4. t3 = 2
  5. count = 2
  6. while (true)
  7. t3 = t2 + t1
  8. t1 = t2
  9. t2 = t3
  10. count = count+1
  11. if (t3.to_s().length >= 1000)
  12. puts count
  13. return
  14. end
  15. end
  16. return
  17. end
  18. fib()
Success #stdin #stdout 0.81s 5948KB
stdin
Standard input is empty
stdout
4782