最基本的解法
sum = 0; n = 1; While[Fibonacci[n] <= 4000000, If[EvenQ[Fibonacci[n]], sum = Fibonacci[n] + sum]; n++] sum
时间: 2024-10-14 09:51:53
最基本的解法
sum = 0; n = 1; While[Fibonacci[n] <= 4000000, If[EvenQ[Fibonacci[n]], sum = Fibonacci[n] + sum]; n++] sum