佬,为什么第一个能过,第二个就过不?了
查看原帖
佬,为什么第一个能过,第二个就过不?了
1068867
ll12313123123楼主2023/11/23 12:54
using namespace std;
const float QQ=pow(5.0,0.5);
int main()
{
    int n;
    scanf("%d",&n);
    printf("%.2f",(pow((1.0+sqrt(5.0))/2,n*1.0)-pow((1.0-sqrt(5.0))/2,n*1.0))/sqrt(5.0));
    return 0;
}```
```#include<bits/stdc++.h>
using namespace std;
const float QQ=pow(5.0,0.5);
int main()
{
    int n;
    scanf("%d",&n);
    printf("%.2llf",(pow((1.0+QQ)/2,n*1.0)-pow((1.0-QQ)/2,n*1.0))/QQ);
    return 0;
}```
2023/11/23 12:54
加载中...