You are viewing a single comment's thread. Return to all comments →
import static java.lang.System.in; class Prime { public void checkPrime(int... x) { StringBuffer bf=new StringBuffer(); for(int g:x) { if(new BigInteger(""+g).isProbablePrime(1)) bf.append(g+" "); //System.out.print(g+" "); } System.out.println(bf); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Prime Checker
You are viewing a single comment's thread. Return to all comments →
import static java.lang.System.in; class Prime { public void checkPrime(int... x) { StringBuffer bf=new StringBuffer();
for(int g:x) { if(new BigInteger(""+g).isProbablePrime(1)) bf.append(g+" "); //System.out.print(g+" "); } System.out.println(bf); } }