<?php
header("Content-Type: text/html; charset=UTF-8"); $digits=array(10,15,18,19,13,11,17); if ($digits[0]>$digits[1]) {$i_f_max = 0; $i_s_max = 1;} else {$i_f_max = 1; $i_s_max = 2;}
for ($i = 2; $i < count($digits); $i++){ if ($digits[$i] > $digits[$i_f_max]) {
$i_s_max=$i_f_max;
$i_f_max=$i;
} else {
if ($digits[$i] > $digits[$i_s_max]) {$i_s_max = $i;}
}
}
echo "Наибольшие числа в массиве: $digits[$i_f_max] и $digits[$i_s_max]\n";
?>
PD9waHAKICAgIGhlYWRlcigiQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgiKTsKICAgICRkaWdpdHM9YXJyYXkoMTAsMTUsMTgsMTksMTMsMTEsMTcpOwogICAgaWYgKCRkaWdpdHNbMF0+JGRpZ2l0c1sxXSkgeyRpX2ZfbWF4ID0gMDsgJGlfc19tYXggPSAxO30gZWxzZSB7JGlfZl9tYXggPSAxOyAkaV9zX21heCA9IDI7fQogICAgZm9yICAoJGkgPSAyOyAkaSA8IGNvdW50KCRkaWdpdHMpOyAkaSsrKXsKICAgICAgICBpZiAoJGRpZ2l0c1skaV0gPiAkZGlnaXRzWyRpX2ZfbWF4XSkgewogICAgICAgICAgICAkaV9zX21heD0kaV9mX21heDsKICAgICAgICAgICAgJGlfZl9tYXg9JGk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgaWYgKCRkaWdpdHNbJGldID4gJGRpZ2l0c1skaV9zX21heF0pIHskaV9zX21heCA9ICRpO30KICAgICAgICB9CiAgICB9CiAgICBlY2hvICLQndCw0LjQsdC+0LvRjNGI0LjQtSDRh9C40YHQu9CwINCyINC80LDRgdGB0LjQstC1OiAkZGlnaXRzWyRpX2ZfbWF4XSDQuCAkZGlnaXRzWyRpX3NfbWF4XVxuIjsKPz4=