Help for this page

Select Code to Download


  1. or download this
    foreach my $i ($#$arr)
    {
        $avg = ($i + ($avg ? $avg : $i)) / 2;
    }
    
  2. or download this
    $avg = (...(($arr->[0]/2 + $arr->[1])/2 + $arr->[2])/2 + ... $arr->[$#
    +$arr])/2;
    
  3. or download this
    my @x = (10, 7, 5, 10, 50, 70, 75, 72, 79, 80);
    
    ...
    7: 20.3359375
    10: 13.66796875
    11.833984375
    
  4. or download this
    my @x = (10, 7, 5, 10, 50, 70, 75, 72, 79, 80);
    
    ...
    7: 441
    10: 448
    45.8