| ||||||||||
| 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:这样用java,为什么会runtime error?In Reply To:这样用java,为什么会runtime error? Posted by:greatshark at 2009-10-15 12:53:12 我也碰到了 不知道为什么
> import java.util.*;
> import java.math.*;
>
> public class Main
> {
> public static void main(String[] argu)
> {
> Scanner scan=new Scanner(System.in);
> int t;
> BigInteger n,i,two=new BigInteger("2");
>
> t=scan.nextInt();
> while(t-->0)
> {
> n=scan.nextBigInteger();
> if(n.isProbablePrime(10))
> System.out.println("Prime");
> else
> {
> for(i=two;n.mod(i).equals(BigInteger.ZERO)==false;i=i.add(BigInteger.ONE));
> System.out.println(i);
> }
> }
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator