题解 | #Fibonacci#

Fibonacci

https://www.nowcoder.com/practice/17ad6908e36a49f4b06ea96936e8bb25

#include <iostream>
using namespace std;

int main() {
    int n;
    cin>>n;
    int a=0,b=1;
    while(n--){
        int c=a+b;
        a=b;
        b=c;
    }
    cout<<a<<endl;
}

全部评论

相关推荐

09-19 12:15
门头沟学院 Java
迷茫的大四🐶:这下是真的打牌了,我可以用感谢信和佬一起打牌吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务