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 |
作如下修改即可!In Reply To:用java为什么错??? Posted by:JLK at 2006-02-08 14:48:00 > import java.math.BigInteger; > import java.util.Scanner; > public class Main //把public去掉 > { > public static void main(String[] args) throws Exception > { > BigInteger result = new BigInteger("0"); > > while(true) > { > Scanner cin=new Scanner(System.in); //把这句放到while(true)外面 > BigInteger a = cin.nextBigInteger(); > result = result.add(a); > if(a.toString().equals("0")) > { > System.out.println(result); > break; > } > } > } > } > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator