Fibbonacci numberTime
limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 17675 Accepted Submission (s): 8422
Problem Descriptionyour objective for this question are to develop a program which would generate a Fibbonacci number. The FIBBONACCI function is defined as such:
F (0) = 0
F (1) = 1
F (n) = f (n-1) + f (n-2)
Your program should is able to handle values of N in the range 0 to 50.
Inputeach test case consists of one, integer n in a, where 0≤n≤50. The input is terminated by-1.
Outputprint out the ' answer in a ' for each test case.
Sample Input
345-1
Sample Output
235 This is one of the most basic basics of programming topic, in ACM above the words is water problem, we use the external table method, you can reduce the complexity of time. the code is as follows:
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Readers are welcome to comment and correct
Hangzhou Electric (HDU) 2070 Fibbonacci number water problem