aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/functional/61_rec_fibonacci.sy
blob: f8e21992733bdfa0e5b35086d66cd1ef9828e07a (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
26
27
int n;
int f(int x)
{
	if(x==1)
		return 1;
	if(x==2)
		return 1;
	int a;
	int b;
	a=x-1;
	b=x-2;
	int c;
	c = f(a)+f(b);
	return c;
}
int main()
{
	n=getint();
	int t;
	int xx;
	t=f(n);
	putint(t);
	int newline;
	newline = 10;
	putch(newline);
	return t;
}