标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 17352 Accepted Submission(s):
5778
import java.math.BigDecimal;
import java.util.Scanner;
public class Main1715 {
public static void main(String []args) {
BigDecimal []a=new BigDecimal[1006];
a[0]=new BigDecimal(1);
a[1]=new BigDecimal(1);
for(int i=2;i<1006;i++){
a[i]=a[i-1].add(a[i-2]);}
Scanner cin=new Scanner(System.in);
while(cin.hasNext()){
int n=cin.nextInt();
for(int j=0;j<n;j++){
int k=cin.nextInt();
System.out.println(a[k-1]);
}
}
}
}
标签:
原文地址:http://www.cnblogs.com/1314wamm/p/5685999.html