19 lines
412 B
Java
19 lines
412 B
Java
public class FibonacciLent{
|
|
|
|
public static long fibo(long indice){
|
|
if(indice==0){
|
|
return 0;
|
|
}
|
|
else if(indice==1){
|
|
return 1;
|
|
}
|
|
else{
|
|
return fibo(indice-1)+fibo(indice-2);
|
|
}
|
|
}
|
|
|
|
public static void main(String args[]){
|
|
long indicemax=Long.parseUnsignedLong(args[0]);
|
|
System.out.println("Le terme n°"+indicemax+" de la suite de Fibonacci est égal à "+fibo(indicemax));
|
|
}
|
|
} |