跳到正文

闲话

黄金分割比

Blue_Subway约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月20日
更新
2025年12月23日
篇幅
约 1 分钟

版本

  1. v1当前

今天@Rcwh_De_Shary 告诉我斐波那契数列

C++
#include<bits/stdc++.h>
#define AK_IOI using namespace std;int main()
AK_IOI{
	int n;
	cin>>n;
	vector<long long>a(n+1);
	a[1]=1,a[2]=2;
	for(int i=3;i<=n;i++){
		a[i]=a[i-1]+a[i-2];
		double s=a[i]*1.0/a[i-1];
		printf("%.50lf ",s);
	}
	return 0;
}

然后他发现输出接近于1.618(黄金分割比)
然后我保留了50位小数
1.61803398874989490252573887119069695472717285156250
shary还是太强了

原文