Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. fibLead = 1; fibCurrent = 0; fibTrail = 0; fibSum = 0;
  2.  
  3. while (fibLead <= 4000000):
  4.  
  5. fibTrail = fibCurrent
  6. fibCurrent = fibLead
  7. fibLead = fibCurrent + fibTrail
  8.  
  9. if fibLead %2 == 0:
  10. fibSum += fibLead
  11. print (fibSum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement