properly rename october 2013 mispell

This commit is contained in:
Xevion
2020-02-22 05:48:28 -06:00
parent 22ed622f05
commit f1529d4a14
103 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import static java.lang.System.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class problem9 {
public static void main(String[] args) throws FileNotFoundException {
File input = new File("input.dat");
Scanner read = new Scanner(input);
while (read.hasNextInt()) {
int x = read.nextInt(); int y = read.nextInt();
boolean isSexy = (Math.abs(x - y) == 6) && (isPrime(x) && isPrime(y));
out.println((isSexy) ? "SEXY" : "NOT");
}
}
// Super crap prime function, could be optimized as hell but whatever
static boolean isPrime(int n) {
for(int x = n - 1; x > 1; x-=1) {
if(n % x == 0)
return false;
}
return true;
}
}