Beispiel #1
0
int main () {
	int N,i;
	printf("Inserisci n: ");
	scanf("%d",&N);
	T = (int *) malloc ( (N+1)*sizeof(int) );
	T[0] = 0;
	T[1] = 1;
	for(i=2;i<=N;i++)
		T[i] = -1;
	printf("FIbonacci iterativo = %d\n",fibo_iter(N));
	printf("FIbonacci ricorsivo = %d\n",fibo_ric(N));
	printf("FIbonacci dinamica  = %d\n",fibo_dinam(N));
    return 0;
}
Beispiel #2
0
int main(int argc, char **argv) {
	//fprintf(stderr, "Fibonaccital %i är %i\n", 5, fibo_rec(0, 1, 1, 5));
	fprintf(stderr, "Fibonaccital %i är %i\n", 5, fibo_iter(5));

	return 0;
}