当前位置:网站首页>2019年蜀山区第十五届青少年信息学竞赛
2019年蜀山区第十五届青少年信息学竞赛
2022-07-04 17:40:00 【小图灵编程】
第一题 求和
【问题描述】
斐波拉契数列,又称黄金分割数列。因数学家列昂纳多·斐波那契以兔子繁殖为例子而引入,故又称为“兔子数列”,指的是这样一个数列:1、1、2、3、5、8、13、21、34、······在数学上,斐波那契数列以如下被以递推的方式定义:F(1)=1,F(2)=1,F(n)=F(n-1)+F(n-2)(n>=3)。
斐波那契数列的前两项分别为1,1。以后每项为前两项之和。现在输入n,要求斐波那契数列前n项的和(1<=n<=5000)。
【输入格式】sum.in
输入只有一个数n,表示求斐波那契数列前n项的和。
【输出格式】sum.out
输出斐波那契数列前n项的和
【
边栏推荐
- VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
- My colleagues quietly told me that flying Book notification can still play like this
- Li Kou brush question diary /day2/2022.6.24
- 神经网络物联网平台搭建(物联网平台搭建实战教程)
- LeetCode第300场周赛(20220703)
- 大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
- Principle and application of ThreadLocal
- TorchDrug教程
- Mxnet implementation of googlenet (parallel connection network)
- 神经网络物联网应用技术学什么
猜你喜欢
[go language question brushing chapter] go conclusion chapter | introduction to functions, structures, interfaces, and errors
Scala basic tutorial -- 17 -- Collection
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
[uniapp] uniapp development app online Preview PDF file
TorchDrug教程
性能优化之关键渲染路径
Uni app and uviewui realize the imitation of Xiaomi mall app (with source code)
Deleting nodes in binary search tree
Process of manually encrypt the mass-producing firmware and programming ESP devices
Wireshark抓包TLS协议栏显示版本不一致问题
随机推荐
C语言打印练习
输入的查询SQL语句,是如何执行的?
国元期货是正规平台吗?在国元期货开户安全吗?
使用SSH
问下各位大佬有用过cdc直接mysql to clickhouse的么
自由小兵儿
One question per day (2022-07-02) - Minimum refueling times
Halcon模板匹配
Rookie post station management system based on C language
启牛开的证券账户安全吗?
发送和接收IBM WebSphere MQ消息
Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
From automation to digital twins, what can Tupo do?
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
My colleagues quietly told me that flying Book notification can still play like this
利用策略模式优化if代码【策略模式】
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
6.26cf simulation match B: solution to array reduction problem
redis分布式锁的8大坑总结梳理
[uniapp] uniapp development app online Preview PDF file