Ver Mensaje Individual
  #15 (permalink)  
Antiguo 03/10/2011, 13:24
aurson
 
Fecha de Ingreso: octubre-2011
Mensajes: 36
Antigüedad: 12 años, 6 meses
Puntos: 2
Respuesta: Múltiplos de cinco en PHP/algorismo

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