Help for this page

Select Code to Download


  1. or download this
    5  -6  8  10  12  3  10
    0  0   0  0   0   0  1 = 10
    ...
    0  0   0  0   1   0  1 = 12, 10
    ...
    1  1   1  1   1   1  1 = 5, -6, 8, 10, 12, 3, 10
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
        my $total = sum( map {$bit[$_] ? $amount[$_] : 0 } 0 .. $#bit);
        print "$total\n";
    }