public class Main {
public static void Fibonacci(long n) {
long i,n0=1,n1=0,c;
for (i=1;i<=n;i++) {
c=n0+n1;
System.out.print(c + " ");
n0=n1;
n1=c;
}
}
public static void main(String[] args) {
Fibonacci(7);
}
}
No hay comentarios:
Publicar un comentario