summaryrefslogtreecommitdiffstats
path: root/019.pl
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-14 22:23:13 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-14 22:23:13 -0500
commit111cc0e78e8201e6118ca8ebee226a7cf3d34462 (patch)
tree9007da0881fcb6f25d3e1bb6b69d2d5ed5f8fca6 /019.pl
parent796ed7cd63f1ecf8b04c4d75e0f141e6a84fff55 (diff)
downloadprojecteuler-111cc0e78e8201e6118ca8ebee226a7cf3d34462.tar.gz
projecteuler-111cc0e78e8201e6118ca8ebee226a7cf3d34462.zip
solution for 19
Diffstat (limited to '019.pl')
-rwxr-xr-x019.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/019.pl b/019.pl
new file mode 100755
index 0000000..b0d1cb6
--- /dev/null
+++ b/019.pl
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use DateTime;
+
+my $day = DateTime->new(year => 1901, month => 1, day => 1);
+my $count = 0;
+while ($day->year < 2001) {
+ $count++ if $day->day_of_week == 7 && $day->day_of_month == 1;
+ $day->add(days => 1);
+}
+print "$count\n";