今天继续研究递归的题目:
https://vjudge.net/contest/382188#problem/C
#include <cstdio>
#define maxn 55
long long ans[maxn];
int main(){
int n,a,b;
ans[0]=1;
ans[1]=1;
ans[2]=1;
ans[3]=2;
for(int i =4;i<=50;i++){
ans[i]=ans[i-1]+ans[i-2];
}
scanf("%d",&n);
while(n--){
scanf("%d%d",&a,&b);
printf("%d\n",ans[b-a+1]);
}
return 0;
}