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 jackjack at 2006-02-08 17:23:32 on Problem 1503
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:
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