@@ -0,0 +1,1016 @@
+package java_problems.bignumber;%0D%0A%0D%0Aimport java.math.BigInteger;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * A prime number is a natural number greater than whose only positive divisors%0D%0A * are and itself. For example, the first six prime numbers are 2,3,4,5,11 and 13.%0D%0A * %0D%0A * Given a large integer, , use the Java BigInteger class' isProbablePrime%0D%0A * method to determine and print whether it's prime or not prime.%0D%0A * %0D%0A * Input Format: %0D%0A * A single line containing an integer, (the number to be checked).%0D%0A * %0D%0A * Constraints: %0D%0A * contains at most digits.%0D%0A * %0D%0A * Output Format: %0D%0A * If is a prime number, print prime; otherwise, print not prime.%0D%0A * %0D%0A * Sample Input: %0D%0A * 13%0D%0A * %0D%0A * Sample Output: %0D%0A * prime%0D%0A */%0D%0Apublic class JavaPrimalityTest %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09Scanner in = new Scanner(System.in);%0D%0A%09%09BigInteger n = in.nextBigInteger();%0D%0A%09%09in.close();%0D%0A%09%09if (n.isProbablePrime(1)) %7B%0D%0A%09%09%09System.out.println(%22prime%22);%0D%0A%09%09%7D else %7B%0D%0A%09%09%09System.out.println(%22not prime%22);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D

Add JavaPrimalityTest