This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def EasyScanner(reader): | |
return (word for line in reader for word in line.split()) | |
# License: CC0 1.0 Universal | |
# http://creativecommons.org/publicdomain/zero/1.0/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A program to see if 20141231 and 20150101 are consecutive prime numbers. | |
// Answer: Nope, neither is a prime, and there are lots of primes in between! | |
class Main | |
{ | |
private static int minFactor(int n) | |
{ | |
assert (n >= 3) && (n % 2 != 0); | |
for (int j = 3; j * j <= n; j += 2) { |