#include<stdio.h>
#include<math.h>
int main(){
int n;
scanf("%d",&n);
double s;
s=(pow((1+sqrt(5))/2,n)-pow((1-sqrt(5))/2,n))/sqrt(5);
printf("%.2f",s);
return 0;
}
【洛谷】P1720 月落乌啼算钱(斐波那契数列)——c语言
最新推荐文章于 2024-07-07 09:38:43 发布