Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. package Was.is.hier.verpackt;
  2.  
  3. public class Fibonacci
  4. {
  5. // int v=1;
  6. // int vv=2;
  7. // int erg;
  8.  
  9. // public int fibonacci()
  10. // {
  11. // for(v=1;v<=50;v++)
  12. // erg=v+vv;
  13. // v=vv+erg;
  14. // vv=v+erg;
  15. // return v;
  16. //
  17. // }
  18.  
  19. public static void main(String[] args)
  20. {
  21. int v=1;
  22. int vv=2;
  23. int erg =0;
  24.  
  25. for(v=1;v<=50;v++)
  26. erg=v+vv;
  27. System.out.println(erg);
  28. v=vv+erg;
  29. vv=v+erg;
  30.  
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement