Project Euler 2

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

puts (1..Float::INFINITY).lazy.map{|n| (0..n).inject([1,0]) {|(a,b), _| [b, a+b]}[0] }.take_while{|n| n < 4000000}.select{|x| x % 2 == 0}.reduce(:+)