mirror of
https://bitbucket.org/Mattrixwv/projecteulerjava.git
synced 2025-12-07 01:23:56 -05:00
Updated some typos
This commit is contained in:
@@ -33,14 +33,14 @@ public class Problem2 extends Problem{
|
|||||||
private static final int TOP_NUM = 3999999;
|
private static final int TOP_NUM = 3999999;
|
||||||
|
|
||||||
public Problem2(){
|
public Problem2(){
|
||||||
super("The sum of the even Fibonacci numbers less than 4,000,000");
|
super("What is the sum of the even Fibonacci numbers less than 4,000,000?");
|
||||||
}
|
}
|
||||||
public void solve(){
|
public void solve(){
|
||||||
timer.start();
|
timer.start();
|
||||||
//Get a list of all fibonacci numbers < 4,000,000
|
//Get a list of all fibonacci numbers < 4,000,000
|
||||||
ArrayList<Integer> fibNums = Algorithms.getAllFib(TOP_NUM);
|
ArrayList<Integer> fibNums = Algorithms.getAllFib(TOP_NUM);
|
||||||
Integer sum = 0;
|
Integer sum = 0;
|
||||||
//Step through very element in the list checking if it is even
|
//Step through every element in the list checking if it is even
|
||||||
for(Integer num : fibNums){
|
for(Integer num : fibNums){
|
||||||
//If the number is even add it to the running tally
|
//If the number is even add it to the running tally
|
||||||
if((num % 2) == 0){
|
if((num % 2) == 0){
|
||||||
|
|||||||
Reference in New Issue
Block a user