delete pics to save space
This commit is contained in:
19
history_source/信息学奥赛一本通/1.4.1.20.cpp
Normal file
19
history_source/信息学奥赛一本通/1.4.1.20.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
double a,b,c,ans=0;
|
||||
a=b=c=1;
|
||||
scanf("%d",&n);
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
c=a+b;
|
||||
ans+=c/b;
|
||||
a=b;
|
||||
b=c;
|
||||
}
|
||||
printf("%.4lf\n",ans);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user