Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
java 水过30~~~ c++望尘莫及啊 遇大数果断javaimport java.math.BigInteger; import java.util.Scanner; public class Main { public static void main (String []args) { BigInteger a,b,c,d[]; d=new BigInteger[100]; Scanner in=new Scanner(System.in); while(in.hasNext()) { d[0]=in.nextBigInteger(); d[1]=in.nextBigInteger(); d[2]=in.nextBigInteger(); for(int i=3;i<100;i++) { d[i]=d[i-1].add(d[i-2].add(d[i-3])); } System.out.println(d[99]); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator