2009-02-14 13:20:55來源不明
96北市資訊學科能力競賽 會議中心(Room)
/************************************************************/
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- main()
- {
- int a,b,temp=1,sum=2;
- int x[100];
- while(scanf("%d",&a)==1)
- {
- x[0]=1;x[1]=1;
- if(a!=1)
- {
- for(b=0;b<a;b++)
- {
- x[b+2]=x[b]+x[b+1];
- }
- printf("%d\n",x[b]);
- }
- else
- printf("1\n");
- }
- return 0;
- }