当前位置:网站首页>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项的和
【
边栏推荐
- Mxnet implementation of googlenet (parallel connection network)
- Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
- Don't just learn Oracle and MySQL!
- C language printing exercise
- Principle and application of ThreadLocal
- 每日一题(2022-07-02)——最低加油次数
- Li Kou brush question diary /day2/2022.6.24
- Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
- Wireshark抓包TLS协议栏显示版本不一致问题
- 技术分享 | 接口测试价值与体系
猜你喜欢

一种将Tree-LSTM的强化学习用于连接顺序选择的方法

输入的查询SQL语句,是如何执行的?

Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join

Scala basic tutorial -- 19 -- actor

Scala基础教程--18--集合(二)

What if the self incrementing ID of online MySQL is exhausted?

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题

Don't just learn Oracle and MySQL!

神经网络物联网平台搭建(物联网平台搭建实战教程)

激进技术派 vs 项目保守派的微服务架构之争
随机推荐
发送和接收IBM WebSphere MQ消息
How to open an account is safe,
Caché WebSocket
使用FTP
[go ~ 0 to 1] read, write and create files on the sixth day
6.26CF模拟赛B:数组缩减题解
每日一题(2022-07-02)——最低加油次数
使用canal配合rocketmq监听mysql的binlog日志
Unity给自己的脚本添加类似编辑器扩展的功能案例ContextMenu的使用
Microservice architecture debate between radical technologists vs Project conservatives
[release] a tool for testing WebService and database connection - dbtest v1.0
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
利用策略模式优化if代码【策略模式】
Scala基础教程--13--函数进阶
One question per day (2022-07-02) - Minimum refueling times
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
SSL证书续费相关问题详解
Li Kou brush question diary /day3/2022.6.25
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现