fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,y,z;
  6. x=0;
  7. y=1;
  8. int sum = 0;
  9. int i =0;
  10. while (i<=4000000)
  11. {
  12. z = x+y;
  13. if (z%2==0)
  14. {
  15. sum = sum +z;
  16. }
  17. x = y;
  18. y = z;
  19. i = i + 1;
  20. }
  21. cout<<sum;
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
1110529254