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

我是来贴代码的

Posted by speedcell4 at 2011-08-27 17:40:41 on Problem 3982
In Reply To:Re:java 水过30~~~ c++望尘莫及啊 遇大数果断java Posted by:Delostic at 2011-08-07 18:00:17
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Scanner;

public class Main 
{
	static Scanner cin = new Scanner(System.in);
	static PrintWriter cout = new PrintWriter(System.out, true);

	public static void main(String[] args) 
	{
		BigInteger a,b,c,ans = null;
		while(cin.hasNext())
		{
			c = cin.nextBigInteger();
			b = cin.nextBigInteger();
			a = cin.nextBigInteger();
			for(int i=3;100-i>0;i++)
			{
				ans = a.add(b).add(c);
				c = b;
				b = a;
				a = ans;
			}
			cout.println(ans);
		}
	}
}

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