update
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
public class Fibonacci {
|
||||
public Fibonacci() {
|
||||
|
||||
}
|
||||
|
||||
public int form(int val) {
|
||||
if(val == 0) {
|
||||
return 0;
|
||||
} else if(val == 1) {
|
||||
return 1;
|
||||
} else {
|
||||
return form(val -1) + form(val -2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
public class Appels {
|
||||
|
||||
public Appels(int val) {
|
||||
int indentation = 0;
|
||||
fact(val, indentation);
|
||||
}
|
||||
|
||||
public int fact(int nb, int indentation) {
|
||||
if(nb > 0) {
|
||||
System.out.println(" ");
|
||||
return nb*fact(nb-1,indentation++);
|
||||
} else {
|
||||
Thread.dumpStack();
|
||||
return 1;
|
||||
}
|
||||
System.out.println(nb+"! = "+fact(nb, indentation));
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Appels(Integer.parseInt(args[0]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Tableaux {
|
||||
public Tableaux() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user