题解 1131: C语言训练-斐波纳契数列

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

C语言训练-斐波纳契数列------a+b简洁----Python

1.输入一个数决定输出多少个数列2.先将b输出,因为我们拿了两个值出来3.通过while循环判断输出个数n-=14.a=b,b=a+b,后一个数等于前两个数之和将a输出```pythonn=int(input())a,b=1,1print(b,

还是用列表-斐波纳契数列

摘要:解题思路:生成列表,打印元素注意事项:参考代码:N = int(input())list = [1,1]for i in range(N-2):    list.append(list[-1]+lis……

简洁 !!!

摘要:解题思路:注意事项:参考代码:# include <stdio.h>int main (){         int t;        int y=0,u=1,m=1;         scanf(……

1131: C语言训练-斐波纳契数列

摘要:这里采用的是循环方案,也可以用递归。#include<bits/stdc++.h> using namespace std; int main(){     int n;     cin ……

哈哈嗨,简单捏

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){    int n;    scanf("%d",&n);    int a[n];    a[0]=1;   ……

C语言训练-斐波纳契数列

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int a=1,b=1,c,n;int main(){    cin>>n;    ……