View Code
 1 import java.math.*;
2 import java.io.*;
3 import java.util.*;
4 public class Main{
5 public static void main(String args[])
6 {
7 Scanner cin=new Scanner(System.in);
8 int i,j,t;
9 BigInteger f[]=new BigInteger[1001];
10 f[1]=BigInteger.valueOf(1);
11 f[2]=BigInteger.valueOf(1);
12 for(i=3;i<=1000;i++)
13 {
14 f[i]=f[i-1].add(f[i-2]);
15 }
16 while(cin.hasNext())
17 {
18 t=cin.nextInt();
19 for(i=1;i<=t;i++)
20 {
21 j=cin.nextInt();
22 System.out.println(f[j]);
23 }
24 }
25
26 }
27 }

相关文章:

  • 2021-04-07
  • 2021-05-31
  • 2022-12-23
  • 2021-06-29
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2021-08-23
  • 2021-06-14
  • 2022-12-23
  • 2021-04-04
相关资源
相似解决方案