Posted By

cmm7825 on 05/20/10


Tagged


Versions (?)

Problem 20


 / Published in: Perl
 

  1. #!/usr/bin/perl
  2. use bignum;
  3. use strict;
  4. use warnings;
  5.  
  6. my$factorial = 1;
  7. my $sum = 0;
  8. $factorial *= $_ foreach 1..100;
  9.  
  10. while($factorial =~ m/(\d{1})/g)
  11. {
  12. $sum += int($1);
  13. }
  14.  
  15. print $sum;

Report this snippet  

You need to login to post a comment.