hdu 1715(java)

import java.io.*;
import java.math.*;
import java.util.*;
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		Scanner cin = new Scanner(new BufferedInputStream(System.in));
		int n,num;
		n = cin.nextInt();
		BigInteger a,b,ans;
		for(int i=1 ;i<=n;i++){
			num = cin.nextInt();
			a = BigInteger.valueOf(1);
			b = BigInteger.valueOf(1);
			ans = BigInteger.valueOf(1);
			for(int j=3;j<=num;j++){
				ans = a.add(b);
				a = b;
				b = ans;
			}
			System.out.println(ans);
		}
	}
}			

 

posted @ 2012-11-14 16:13  M_cag  阅读(256)  评论(0编辑  收藏  举报