fork(3) download
  1. class HelloWorld {
  2. public static void main(String[] args) {
  3. int termo1 = 1;
  4. int termo2 = 2;
  5. int soma = 0;
  6. while (termo2 < 100000) {
  7. int novoTermo = termo1 + termo2;
  8. if (novoTermo % 2 == 0) {
  9. soma += novoTermo;
  10. }
  11. termo1 = termo2;
  12. termo2 = novoTermo;
  13. }
  14. System.out.println(soma);
  15. }
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/202847/101
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
60694