Moonset Wu Ti Luo Gu P1720 count money

 

Topic background

(This title track wood with possession of song ...... do not guess ......)

"Love and melancholy story of the first bomb · heartache" the final chapter.

Eating pizza, moonset Wu Ti know beyond their budget. To love and not worry about the big show oneself before God, had to bite the bullet and go count the money ......

Title Description

After count the money, moonset Wu Ti thought: "You TMD pit me (read the following with Taiwanese) owned by acres of grain by cup eh, (hereinafter read in English) is Hitt tour!" So when love and sorrow when asked how much money the great God, moonset Wu Ti said a bunch of gibberish. Great God of love and sorrow, said: "Forget it Forget it, I just ask how much the price of n dishes?" Moonset Wu Ti wrote:   . Due to the large theology of love and sorrow over-programmed, so we used a minute to obtain the results of Fn. Moonset Wu Ti was taken aback. You can learn to love God with great sorrow calculated value Fn do?

Input Format

Only one line: n

Output Format

Only one line: Fn, with two decimal places.

Sample input and output

Input # 1
6
Output # 1
8.00

Description / Tips

Simple dead ......

All data: n <= 48

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 int main()
 4 {
 5     double f[50];
 6     int n,i;
 7     f[0]=0;
 8     f[1]=1;
 9     f[2]=1;  
10     cin>>n;
11     for (i=3;i<=n;i++)
12     f[i]=f[i-1]+f[i-2];  
13     printf("%0.2lf",f[n]); 
14     return 0;
15 }

Guess you like

Origin www.cnblogs.com/anbujingying/p/11309167.html