En el de traducir el algoritmo o algorismo (como mejor os guste)
a PHP, he trabajado en este código, pero creo que tiene errores:
Código PHP:
/* get the string & separate the numbers */
$cadena = $_GET["cadena"];
$var1 = explode(',', $cadena);
$num = array_shift($var1);
$m = $num;
/* print numbers one to one */
while ( $num!=NULL )
{
print $num."<br>";
$num = array_shift ($var1) ;
}
$high = $_GET["high"];
if ($high > 0) {
$i=1;
while ($i < $high) {
if ($n > $m) {
$m=$n;
}
$i=$i+1;
}
} else {
$m = 0;
}
print $m;