当前位置: 移动技术网 > IT编程>开发语言>C/C++ > 菲波数

菲波数

2019年11月24日  | 移动技术网IT编程  | 我要评论

time limit: 1000/1000 ms (java/others)    memory limit: 32768/32768 k (java/others)
total submission(s): 12716    accepted submission(s): 4352


problem description
fibonacci数列,定义如下:
f(1)=f(2)=1
f(n)=f(n-1)+f(n-2) n>=3。
计算第n项fibonacci数值。
 

 

input
输入第一行为一个整数n,接下来n行为整数pi(1<=pi<=1000)。
 

 

output
输出为n行,每行为对应的f(pi)。
 

 

sample input
5 1 2 3 4 5
 

 

sample output
1 1 2 3 5
 

 思路:很纯粹的高进度加法

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网