summaryrefslogtreecommitdiff
path: root/019.py
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:21:45 +0200
committerReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:35:09 +0200
commit95341b61b030c9e1290f3b326cb7ec584f543aea (patch)
tree852386fa04d32eb859bca11c0eff7b5ef9e50f00 /019.py
parent571164d977f91925c4c76a292f74f5f93d09ae23 (diff)
moved files to higher directory after split to new repositoryHEADtrunk
Diffstat (limited to '019.py')
-rw-r--r--019.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/019.py b/019.py
new file mode 100644
index 0000000..187b45e
--- /dev/null
+++ b/019.py
@@ -0,0 +1,17 @@
+days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+
+day = 7 # first sunday in 1900
+count = 0
+
+for year in range(1900, 2001):
+ for month in range(1, 13):
+ if day == 1 and year >= 1901:
+ count += 1
+ if month == 2 and year % 4 == 0:
+ day -= 1
+ while(day <= days[month-1]):
+ day += 7
+ day -= days[month-1]
+
+print count
+