Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/05/2012, 14:21
kmilo1080
 
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 2 meses
Puntos: 0
¿como sacar numero mayor y menor en ejercicio de matriz en jsp?

estoy haciendo un codigo en jsp de matrices y quiero meterle un contador para que me diga cual es el numero mayor y el numero menor y cuantas veces se repite un numero en dicha matriz y en q parte del codigo lo pongo...si tengo 3 uno q pide el numero de filas y columnas y otros dos recibir.jsp y ver.jsp...aqui esta el codigo de ver jsp

<%
int recibirVal=Integer.parseInt(request.getParameter(" lugares"));
int filas=Integer.parseInt(request.getParameter("filas "));
String cajas="";
int pares = 0;
int valor = 0;
%>

<!--escribiendo valores para que reciba-->
<b>Valores de la Matriz</b>
<table width='50%' border='3' cellpadding='3'>

<%
for(int i=1; i<=recibirVal; i++)
{

cajas=request.getParameter("txt"+i);
out.println("<td>"+cajas+"</td>");
if(i%filas==0)
{
<%
for(int i=1; i<=recibirVal; i++)
{

cajas=request.getParameter("txt"+i);
out.println("<td>"+cajas+"</td>");
if(i%filas==0)
{
out.println("<tr/>");
}

}

%>

</table>
<br>