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 |
Re:菜鸟求救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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator