解题思路: 斐波那契数列
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a[10000]; memset(a,0,sizeof(a)); a[0] = 1; a[1] = 1; for(int i=2;i<10000;i++) a[i] = (a[i-1]%7654321 + a[i-2]%7654321)%7654321; int n; cin>>n; cout<<a[n-1]<<endl; return 0; }
0.0分
1 人评分
A+B for Input-Output Practice (IV) (C语言代码)浏览:509 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:691 |
九宫重排 (C++代码)浏览:1326 |
A+B for Input-Output Practice (IV) (C++代码)浏览:676 |
字符串比较 (C语言代码)答案错误????浏览:596 |
母牛的故事 (C语言代码)浏览:549 |
字符逆序 (C语言代码)浏览:455 |
1124题解浏览:591 |
循环入门练习6 (C语言代码)浏览:953 |
链表数据求和操作 (C语言代码)浏览:941 |