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写 觉得有点对不起观众啊

Posted by fanmcgrady at 2011-06-23 17:22:31 on Problem 1503
import java.math.BigInteger;
import java.util.Scanner;

/**
 *
 * @author FangZhiyang
 */
public class Main
{
	public static void main(String[] args)
	{
		Scanner cin = new Scanner(System.in);
		String input = cin.nextLine();
		BigInteger result = new BigInteger("0");
		while (!input.equals("0"))
		{
			result = result.add(new BigInteger(input));
			input = cin.nextLine();
		}
		System.out.println(result);
	}
}

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