/*
* 1568.cpp
*
* Created on: 2010-10-2
* Author: wyiu
*/
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int f[30];
f[0]=0;
f[1]=1;
for(int i=2; i<=20; i++)
{
f[i] = f[i-1] + f[i-2];
}
int n;
while(scanf("%d", &n) != EOF)
{
if(n <= 20)
{
printf("%d\n", f[n]);
fflush(stdout);
continue;
}
double a = -0.5*log10(5) + n*(log10(0.5*(1+sqrt(5.0))));
double r = a - int(a);
double b = pow(10, r);
while(b < 1000)
{
b*=10;
}
printf("%d\n", int(b));
fflush(stdout);
}
return 0;
}
posted on 2010-10-03 16:42
wyiu 阅读(429)
评论(0) 编辑 收藏 引用