黄煜涵


私信TA

用户名:dotcpp0750536

访问量:841

签 名:

等  级
排  名 3005
经  验 2039
参赛次数 6
文章发表 29
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

const ll N=1e6;

ll a[N] ;

int main()

{

    int z;

    cin>>z;

    a[1]=1;

    a[2]=1;

    for(int i=3; i<=40; i++)

    {

        a[i]=a[i-1]+a[i-2];

    }

    for(int i=1; i<=z; i++)

    {

        cout<<a[i]<<" ";

    }

    return 0;

}


 

0.0分

1 人评分

  评论区

  • «
  • »