HDU 1715 大菲波数
JAVA水过
import java.io.*; import java.util.*; import java.math.*; public class aa { public static void main( String[] args ) { BigInteger f[] = new BigInteger[1005]; f[1] = BigInteger.valueOf(1); f[2] = BigInteger.valueOf(1); for( int i = 3; i < 1005; ++i ) f[i] = f[i-1].add(f[i-2]); Scanner cin = new Scanner(System.in); int t; t = cin.nextInt(); for( int i = 0; i < t; ++i ) { int p; p = cin.nextInt(); System.out.println( f[p] ); } } }
本人还是新手 ,转载请注明来自Lvsi‘s home