Created
December 18, 2011 01:13
-
-
Save macalinao/1492020 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.crimsonrpg.professions; | |
/** | |
* | |
* @author simplyianm | |
*/ | |
public class Blah { | |
public static void main(String[] args) { | |
int a = 0; | |
int b = 1; | |
int c = 0; | |
int sum = 0; | |
while (c < 4000000) { | |
c = a + b; | |
a = b; | |
b = c; | |
if (c % 2 == 0) { | |
sum += c; | |
} | |
} | |
System.out.println(sum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment