JUNIORCEDE1

Untitled

Feb 25th, 2021
1,320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. int anterior = 0;
  2. int anteriorAnterior = 1;
  3. int limite = 30;
  4. String texto = anterior+" "+anteriorAnterior+" ";
  5. for (int i = 0; i < limite; i++) {
  6.     int fn =  anterior+anteriorAnterior;
  7.     anteriorAnterior = anterior;
  8.     anterior = fn;
  9.     texto += fn+" ";
  10. }
  11. System.out.println(texto);
Advertisement
Add Comment
Please, Sign In to add comment