Skip to content

Instantly share code, notes, and snippets.

@Darksonn
Created April 11, 2014 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Darksonn/10485787 to your computer and use it in GitHub Desktop.
Save Darksonn/10485787 to your computer and use it in GitHub Desktop.
public class ModulusFinder {
public static void main(String[] args) {
int i = 0;
while (!test(i)) {
System.out.println(i++);
}
System.out.println("lowest answer: " + i);
}
static boolean test(int x) {
if (x % 3 != 1) {
return false;
}
if (x % 5 != 2) {
return false;
}
if (x % 11 != 8) {
return false;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment