标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 42691 Accepted Submission(s): 20698
又是一个找规律的题目:
斐波那契热数列的应用。。。
#include <iostream> using namespace std; int main() { int n; __int64 a[60]; while(cin >> n) { a[1] = 1; a[2] = 2; for(int j = 3; j <= n; j++) a[j] = a[j - 1] + a[j - 2]; cout << a[n] << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/lyf-acm/p/5458037.html