#include<stdio.h> void trade (a,b,c) { b=c; a=b; } main() { int n,i,fbn,fbn1,fbn2; printf("please input the month which you want to know:"); scanf("%d\n",&n); if(n>13 || n<1) printf("error due to the wrong input !\n"); else if(n==1|| n==2) printf("the total number of the rabbits are 1.\n"); else fbn1=fbn2=1; for(i=3;i<=n;i++) { fbn=fbn1+fbn2; fbn2=fbn1; fbn1=fbn; } printf("the final number of the rabbits is :%d",fbn); }

评论