标签:this ios term each border test val not bottom
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 22530 Accepted Submission(s): 10375
3 4 5 -1
2 3 5you can use 64bit integer: __int64HintNote:
费波纳列数
#include <iostream> using namespace std; const int limit = 51; _int64 fib[limit]; int main() { int num; fib[0] = 0; fib[1] = 1; for (int i = 2; i <= limit; i++) { fib[i] = fib[i - 1] + fib[i - 2]; } while (cin >> num && num!=-1) { cout << fib[num] << endl; } return 0; }
标签:this ios term each border test val not bottom
原文地址:http://www.cnblogs.com/theskulls/p/6057386.html