Help for this page

Select Code to Download


  1. or download this
    my $max = [ $x[ 0 ], $y[ 0 ] ];
    for my $i ( 1..$#x ) {
    ...
      $max = [ $x[ $i ], $y[ $i ] ];
    }
    print "max at ($max->[ 0 ], $max->[ 1 ])\n";
    
  2. or download this
    my $max = [ $x[ 0 ], $y[ 0 ] ];
    for my $i ( 1..$#x ) {
      $max = [ $x[ $i ], $y[ $i ] ] if $y[ $i ] > $max->[ 1 ];
    }
    print "max at ($max->[ 0 ], $max->[ 1 ])\n";