You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ZW/求斐波那契数列

19 lines
268 B

#include<stdio.h>
int Fibon1(int n)
{
if(n == 1||n == 2)
{
return 1;
}
else{
return Fibon1(n-1) + Fibon1(n-2);
}
}
int main()
{
int n,s;
scanf("%d",&n);
s = Fibon1(n);
printf("%d",s)
return 0;
}