Posted By

cmm7825 on 06/20/10


Tagged


Versions (?)

Problem 19


 / Published in: Perl
 

  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. use Date::Calc qw(Day_of_Week);
  7.  
  8. my $day = 1;
  9. my $sum = 0;
  10.  
  11. for my $year (1901..2000){
  12. for my $month (1..12){
  13. if(Day_of_Week($year, $month, $day) == 7){ $sum++; }
  14. }
  15. }
  16.  
  17. print "$sum\n";

Report this snippet  

You need to login to post a comment.