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.
fun/斐波那契数列.cpp

22 lines
267 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 = 0;
int ret = 0;
scanf("%d", &n);
ret = Fibon1(n);
printf("ret=%d", ret);
return 0;
}