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 |
这样用java,为什么会runtime error?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