fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception {
  11. int total=0;
  12. int x=0;
  13. int y=1;
  14. System.out.println("F0= "+ x);
  15. System.out.println("F1= "+ y);
  16. for (int num=2; num<=100; num++){
  17. total=x+y;
  18. if (total<10000) {
  19. System.out.println("F" + num +"= " +total);
  20. }
  21. x=y;
  22. y=total;
  23. }
  24. }
  25. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
F0= 0
F1= 1
F2= 1
F3= 2
F4= 3
F5= 5
F6= 8
F7= 13
F8= 21
F9= 34
F10= 55
F11= 89
F12= 144
F13= 233
F14= 377
F15= 610
F16= 987
F17= 1597
F18= 2584
F19= 4181
F20= 6765
F47= -1323752223
F49= -811192543
F50= -298632863
F51= -1109825406
F52= -1408458269
F56= -1781832971
F58= -1418756969
F59= -1055680967
F62= -1709589543
F63= -944741150
F66= -1958435240
F67= -1262539787
F69= -188547518
F73= -2015728079
F74= -433386095
F77= -1036647147
F79= -660827267
F80= -285007387
F81= -945834654
F82= -1230842041
F85= -1289228135
F86= -401779575
F87= -1691007710
F88= -2092787285
F90= -1581614984
F91= -1070442683
F94= -2079590721
F95= -1507123775
F97= -798870975
F98= -90618175
F99= -889489150
F100= -980107325