您的位置:首页 > 博客中心 > 互联网 >

[hdu-2044] 一只小蜜蜂

时间:2022-04-20 21:57

import java.util.Scanner; public class Main { static long[] count = new long[50]; static { count[0] = count[1] = 1; for (int i = 2; i < 50; i++) { count[i] = count[i - 1] + count[i - 2]; } } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); while (n-- != 0) { int a = scanner.nextInt(); int b = scanner.nextInt(); int num = b - a; System.out.println(count[num]); } } }

本类排行

今日推荐

热门手游