2018-03-12 22:29:27 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2018-03-12 15:20:16 +01:00
|
|
|
#define func1
|
|
|
|
|
2018-03-12 21:11:29 +01:00
|
|
|
int func3(int x) {
|
2018-03-12 22:36:48 +01:00
|
|
|
return pow(x, 3) - 3 * pow(x, 2) - x + 3;
|
2018-03-12 15:20:16 +01:00
|
|
|
}
|
2018-03-12 21:11:29 +01:00
|
|
|
|
|
|
|
int func2(int x) {
|
|
|
|
return x - 10;
|
|
|
|
}
|
|
|
|
|
2018-03-12 22:29:27 +01:00
|
|
|
int recurse1(int count) {
|
|
|
|
if(count >= 0) {
|
|
|
|
printf("Recurse 1: %d\n", func3(count - 1));
|
|
|
|
return recurse1(count - 1);
|
|
|
|
}else return 0;
|
2018-03-12 21:11:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-12 22:29:27 +01:00
|
|
|
int recurse2(int count) {
|
|
|
|
if(count >= 0) {
|
|
|
|
printf("Recurse 2: %d\n", func3(count - 1));
|
|
|
|
return recurse1(count - 1);
|
|
|
|
}else return 0;
|
2018-03-12 22:36:48 +01:00
|
|
|
}
|