Posted By

cmm7825 on 06/20/10


Tagged


Versions (?)

Problem 30


 / Published in: Perl
 

  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. my $i = 10;
  6. my $total_sum = 0;
  7.  
  8. while($i < 200000){
  9. my $sum = 0;
  10. while($i =~ m/(.)/g){
  11. $sum += $1 ** 5;}
  12. if($sum == $i){
  13. $total_sum += $sum;}
  14. $i++;
  15. }
  16.  
  17. print "$total_sum\n";

Report this snippet  

You need to login to post a comment.