//转载:http://blog.csdn.net/huntinggo/article/details/19683285
#include <cstdio>#include <iostream>using namespace std;int main(){ long long fib[1000]; int a[105]; fib[0] = 0; fib[1] = 1; int f = 0; //1e18是long long 类型的取值范围 for(int i = 2; i < 1e18; i++){ fib[i] = fib[i - 1] + fib[i - 2]; f++; } int x = fib[f - 2]; int y = fib[f - 1]; for(int i = 0; i < 101; i++){ a[i] = x / y; x = (x % y) * 10; PRintf("%d",a[i]); } printf("/n"); getchar(); return 0;}新闻热点
疑难解答