You are viewing a single comment's thread. Return to all comments →
C++ implementation using this algorithm!
long total = 0; long previous = 0; long current = 2; while(current < n) { total += current; long aux = current; current = current * 4 + previous; previous = aux; } cout << total << "\n";
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
C++ implementation using this algorithm!