Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
public static boolean prime(long a){
|
||||
if(a == 2){
|
||||
return true;
|
||||
}else if(a <= 1 || a % 2 == 0){
|
||||
return false;
|
||||
}
|
||||
long max = (long)Math.sqrt(a);
|
||||
for(long n= 3; n <= max; n+= 2){
|
||||
if(a % n == 0){ return false; }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
public static boolean prime(int n) {
|
||||
return !new String(new char[n]).matches(".?|(..+?)\\1+");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue