Help for this page

Select Code to Download


  1. or download this
    while(print "in> " and chomp($a = <STDIN>) and $a >= 0){
        $c++;
    ...
    }
    
    print "max: $M\navg: ".$s/$c."\nmin: $m\n";
    
  2. or download this
    push @r, $a and $s += $a while print "in> " and chomp($a = <STDIN>) an
    +d $a >= 0;
    @r = sort {$a cmp $b} @r;
    print "max: $r[$r-1]\navg: ".$s / @r." \nmin: $r[0]\n";