思考:这道题考验的是罗辑思维,这个网址http://blog.csdn.net/sxhelijian/article/details/42609353的罗辑思维值得学习
#include<stdio.h>
int main()
{
int n;
char d;
int f1,f2,f3,fn;
while(scanf("%d%c",&n,&d)!=EOF)
{
f1=;
f2=;
f3=;
if(n==)
break;
if(n==)
printf("%d\n",f1);
else if(n==)
printf("%d\n",f2);
else if(n==)
printf("%d\n",f3);
else
{
for(int i=;i<=n;i++)
{
fn=f3+f1;
f1=f2;
f2=f3;
f3=fn;
}
printf("%d\n",fn);
} }
}