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

Re:菜鸟求救

Posted by LIANGLIANG at 2005-03-23 13:30:29 on Problem 1503
In Reply To:菜鸟求救 Posted by:zhangzhanbeast at 2005-03-22 21:38:00
import java.io.*;
import java.util.*;
import java.math.*;
public class Main
{
    public static void main (String args[]) throws Exception
    {
        BufferedReader stdin = 
            new BufferedReader(
                new InputStreamReader(System.in));

        BigInteger a = new BigInteger("0");
        do
        {
          String line = stdin.readLine();
          StringTokenizer st = new StringTokenizer(line);
          BigInteger b = new BigInteger(st.nextToken());
          a = a.add(b);
          if (b.equals(BigInteger.ZERO)) break;       
         } while (true);
        System.out.println(a);
        
    }
}

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