Project Euler #2: Even Fibonacci numbers

  • + 1 comment

    cool java solution ...

      public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            int t = in.nextInt();
            for(int a0 = 0; a0 < t; a0++){
                long n = in.nextLong();
                long sum = 2,curr=2, prev=0,temp=0;
                while(temp<=n){
                    sum+=temp;
                    temp=curr*4 + prev;
                    prev = curr;
                    curr = temp;
                }
                System.out.println(sum);
            }
        }
    
    • + 0 comments

      you literally just copied from the other guy lol