[java]代码库
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package rili;
import java.util.Scanner;
public class fei {
public static void main(String[] args) {
int a[] = new int [50];
int T,b,c,dis;
boolean flag = true;
Scanner sc = new Scanner(System.in);
T = sc.nextInt();
while(flag)
{
T--;
if(T<=0)
flag = false ;
b=sc.nextInt();
c=sc.nextInt();
dis = c-b;
a[0] = 1;
a[1] = 1;
for(int i=0;i<=dis;i++){
if(i != 0&& i !=1)
a[i]=a[i-1]+a[i-2];
}
System.out.println(a[dis]);
}
}
}