Saturday, November 20, 2010

Pro Ana Sayings Pro Ana?! =)?

Euler Project - "Resolved" PROJECT EULER

The second problem took a little more work, and taking into account at least in Latin America the majority of those enrolled have not passed the second, okay it has already resolved.

The problem is to code a script to take all pairs terms no greater than 4000000, in Fibonacci series and add, then the code site which resolved that question.

clc;
f (1) = 1, f (2) = 1, RTA = 0;
n = input ('Enter the number of elements to calculate the Fibonacci series');
disp (f (1) ) disp (f (2));
for i = 3: n
f (i) = f (i-1) + f (i-2);
if f (i) \u0026lt;4000000 & & rem (f (i), 2) == 0% sum all terms no more than 4,000,000 pairs

; RTA = RTA + f (i);

end disp (f (i))% displays the items in the series end disp ('sum of the series') end

disp ('The sum of pair terms is not greater than 4000000')
disp (RTA)% shows the result of the sum


esDebian

0 comments:

Post a Comment