You are viewing a single comment's thread. Return to all comments →
java 15:
public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); String n = bufferedReader.readLine(); BigInteger b = new BigInteger(n); boolean isPrime = b.isProbablePrime(100); if(isPrime){ System.out.println("prime"); }else{ System.out.println("not prime"); } bufferedReader.close(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Primality Test
You are viewing a single comment's thread. Return to all comments →
java 15: