We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #2: Even Fibonacci numbers
Project Euler #2: Even Fibonacci numbers
Contest ends in
Sort by
recency
|
615 Discussions
|
Please Login in order to post a comment
function main() { var t = parseInt(readLine()); var a = 0; var arr = [1,2]; for(var a0 = 0; a0 < t; a0++){ var n = parseInt(readLine()); for(var i=2; i< n; i++){ var res = arr[i-1] + arr[i-2]; arr.push(res); } // console.log(arr) for (var j =0 ; j
}
}
Whats wrong in this code it only passes 1 test case ?
Python 3
}
PHP