Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

java 水过30~~~ c++望尘莫及啊 遇大数果断java

Posted by Heng_Xing at 2011-07-23 15:43:40 on Problem 3982 and last updated at 2011-07-23 15:44:27
import 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator