序列 java poj3982
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); BigInteger f[]=new BigInteger[101]; int i; BigInteger a,b; while(cin.hasNext()) { f[0]=cin.nextBigInteger(); f[1]=cin.nextBigInteger(); f[2]=cin.nextBigInteger(); for(i=3;i<=100;i++) { b=f[i-2].add(f[i-3]); f[i]=f[i-1].add(b); } System.out.println(f[99]); } } }
posted on 2011-05-10 20:08 more think, more gains 阅读(139) 评论(0) 编辑 收藏 举报