Help for this page

Select Code to Download


  1. or download this
    use List::Util qw( reduce );
    
    ...
        my ( $str ) = @_;
        reduce { mul2( $a, $b ) } "", split //, $str;
    }
    
  2. or download this
    sub mul2 {
        my ( $str, $have_overflow ) = @_;
    ...
    
        ( $have_overflow ? 1 : '' ) . $ret;
    }
    
  3. or download this
    sub mul2 {
        my ( $str, $have_overflow ) = @_;
    ...
            ( $c % 10 ) or ( length() ? 0 : '' );
        } reverse '', split //, $str;
    }