PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $line = '-2 6 12 -10 4 -20'; //trim(fgets(STDIN)); $nums = explode(' ', $line); $nums_count = count($nums); if ($nums_count<2) die('Wrong input'); rsort($nums); $max = max($nums[0] * $nums[1], $nums[$nums_count-1] * $nums[$nums_count-2]); echo $max;
Show:  
Copy Clear