Skip to content

Instantly share code, notes, and snippets.

@mavant
Created November 22, 2013 00:31
Show Gist options
  • Save mavant/7592575 to your computer and use it in GitHub Desktop.
Save mavant/7592575 to your computer and use it in GitHub Desktop.
Project Euler problem 19
day = 1
hits = 0
year = 1900
while year < 2001:
for x in range(12):
if (day % 7 == 0 and year != 1900):
hits += 1
amount = 31
if ((x < 7 and x % 2 == 1) or (x > 7 and x % 2 == 0)):
amount = 30
if x == 1:
amount = 28
if year % 4 == 0:
if (year % 100 != 0 or year % 400 == 0):
amount = 29
day += amount
year += 1;
print (hits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment