求求大佬指定一下为什么不能完全ac
查看原帖
求求大佬指定一下为什么不能完全ac
504850
ZhangJianan0605楼主2021/5/15 12:13
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	int n;
	cin >> n;
	unsigned long long int a = 0;
	a = (pow((sqrt(5) + 1), n) - pow((1 - sqrt(5)), n)) / sqrt(5) / pow(2, n);
	cout << fixed << setprecision(2) << 1.0*a;
}
2021/5/15 12:13
加载中...