View Code of Problem 23

#include<stdio.h>
//二刷 
long long dp[91];
void Initial(){
	dp[0] = 1;
	dp[1] = 2;
	for(int i=2; i<91; i++){
		dp[i] = dp[i-1] + dp[i-2];
	}
	return;
} 
 
int main(){
	Initial(); //注意这里是Initial! 别写错了 
	int m;
	while(scanf("%d", &m) != EOF) {
		if(m==0) break;
		else printf("%lld\n", dp[m-1]);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 23