TP01 + TP02 Fibbo
This commit is contained in:
parent
081d95d9dc
commit
f39b5c0f50
16
DEV 3.2/TP02/Fibonnaci/Fibbonaci.java
Normal file
16
DEV 3.2/TP02/Fibonnaci/Fibbonaci.java
Normal file
@ -0,0 +1,16 @@
|
||||
public class Fibbonaci {
|
||||
|
||||
public static int fibbo(int n, int r) {
|
||||
switch (n) {
|
||||
case 0:
|
||||
return 0;
|
||||
case 1:
|
||||
return 1;
|
||||
default:
|
||||
return fibbo(n-2, r) + fibbo(n-1, r);
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user