12345678910111213141516171819202122232425262728
#include <iostream> #include <cmath> using namespace std; int main() { int n=4000000; int fib; unsigned int sum=0; int a=0, b=1; for(int i=0; i<n; i++) { fib = a + b; if(fib%2==0) sum+=fib; a = b; b = fib; } cout<<sum; return 0; }