2809:简便的算法求第N项斐波那契数列-《C语言》 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { long long f1 = 1,f2 = 1,f3; int i = 0; int …… 题解列表 2022年12月20日 0 点赞 0 评论 262 浏览 评分:0.0
DP入门 # 2809: 菲波那契数列 摘要:``` // 注意这道题第一下项的下标为0,所以我们最后输出的是dp[n-1] #include #include #include #include using namespace …… 题解列表 2024年10月25日 1 点赞 0 评论 321 浏览 评分:0.0
菲波那契数列(菜鸟解题) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ long long a[100000]; int n; scanf("%d",&n); …… 题解列表 2022年11月28日 0 点赞 0 评论 471 浏览 评分:0.0
建立数组,预设前两项,定义数组构成 摘要:解题思路:建立数组,预设前两项,定义数组的构成。注意事项:输出第k位数,对应的索引是k-1。参考代码:#include<iostream>using namespace std;int main(){…… 题解列表 2024年12月02日 0 点赞 0 评论 446 浏览 评分:0.0
题解 2809: 菲波那契数列 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f(int k){ if(k==1||k==2) { return 1; } return f(k-1)+f(k-…… 题解列表 2025年01月25日 0 点赞 0 评论 480 浏览 评分:0.0
2025/7/28刷题记录 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int num ; scanf("%d…… 题解列表 2025年07月28日 0 点赞 0 评论 64 浏览 评分:0.0
最适合新手的解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int k;scanf("%d",&k);if(k<=2){ printf("1");}else{ int a[…… 题解列表 2024年06月22日 0 点赞 0 评论 294 浏览 评分:0.0
编写题解 2809: 菲波那契数列 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int a[1000],k;cin>>k;a[0]=1;a[1…… 题解列表 2024年05月12日 0 点赞 0 评论 220 浏览 评分:0.0
设置三个变量即可无需数组 摘要:```java import java.util.Scanner; public class Main { public static void main(String[] args)…… 题解列表 2023年10月11日 0 点赞 0 评论 202 浏览 评分:0.0
python 2809: 菲波那契数列 摘要:参考代码:k = int(input()) arr = [0 for _ in range(1, 47)] arr[0], arr[1] = 1,1 for i in range(2, len(…… 题解列表 2024年03月13日 0 点赞 0 评论 267 浏览 评分:0.0