递归,斐波那契数列
int count=0;
int fi(int a)
{
if(a>2)return (fi(a-1)+fi(a-2));
else return 1;
}
int main()
{
int a=40;
int s=0;
if(a>2)s=fi(a);
else s=1;
printf("%d\n",s);
return 0;
}

迭代,斐波那契数列
int di(int n)
{
int le=1,ri=1;
int c=1;
for(;n>2;n--)
{
c=le+ri;
le=ri;
ri=c;
}
return c;
}

int main()
{
int a=1;
int s;
s=di(a);
printf("%d",s);
return 0;
}