Help for this page

Select Code to Download


  1. or download this
    sub sdtt() {
    #sum of digits on Text number
    ...
            map { $t+= $_ } split //, sprintf("%d",$_[0]);
            return $t;
    }
    
  2. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "use List::Util qw(sum);
    ...
    sum of digits of 321023 == 11
    sum of digits of 321 == 6
    sum of digits of 023 == 5