blob: 88f5357954765f5a688abaa04b8eb258527370a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
extern public int Fibo( int n, boolean b )
{
if ( n < 2 ) return n;
int a = Fibo(n-1, b) + Fibo(n-2, false);
if ( b ) print (n + "=" + a);
return a;
}
extern public void t()
{
Fibo( 23, true);
}
extern public void tt()
{
t();
}
// cette routine n'est �videmment pas du tout obtimis�e
// c'est m�me un tr�s mauvais exemple de programmation r�cursive
// pour un test de dur�e, Fibo(23, true) prend
// en mode Debug 67 secondes
// en mode Release 8 secondes
|