
09/05/2007, 04:02
|
 | | | Fecha de Ingreso: mayo-2007 Ubicación: Barcelona
Mensajes: 10
Antigüedad: 17 años, 9 meses Puntos: 0 | |
Re: ayuda Incluye este codigo java en tu jsp
<%
int MIN_MULTIPLO_5 = 10;
int MAX_MULTIPLO_5 = 50;
// Siempre que el min y max ya sean multiplos simplemente tienes q iterar
for (int i=MIN_MULTIPLO_5; i<=MAX_MULTIPLO_5;i+=5)
{
factorial(i);
}
public static long factorial( int n )
{
long f = 1;
if (n > 1)
{
int aux = n;
while (aux > 1)
{
f = f * aux;
aux--;
}
}
return f;
}
%>
Espero que te sirva de algo
Slds! |