diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2014-08-31 20:21:45 +0200 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2014-08-31 20:35:09 +0200 |
| commit | 95341b61b030c9e1290f3b326cb7ec584f543aea (patch) | |
| tree | 852386fa04d32eb859bca11c0eff7b5ef9e50f00 /019.py | |
| parent | 571164d977f91925c4c76a292f74f5f93d09ae23 (diff) | |
Diffstat (limited to '019.py')
| -rw-r--r-- | 019.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 + |
