View Code of Problem 23

#include<stdio.h>

int main(){
	//每一行给你一个数字M,表示第M天。如果M=0,就代表输入结束。(M<=90) 
	int m;
	while(scanf("%d",&m)!=EOF&&m!=0&&m<=90){
		long long int big = 1 ,small = 0,sum = 1,temp;
		while(--m){
			temp = big;
			big += small;
			small = temp;
			sum = big +small;
		}
		printf("%ld\n",sum);
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 23