Título: Duda Pascal Publicado por: Yankris en 12 Diciembre 2015, 19:14 pm Hola , estaba probando el tipo de dato array multidimensional para crear matrices y tengo una problema . El progrma consiste en recibir los datos de una matriz 5x5 y luego sacarla por pantalla , el programa compila pero no funciona bien ya que solo me deja introducir 5 valores y me da la siguinte matriz:
2 2 2 2 2 si los números son 2,3,4,5,6-----> 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 Aquí el código: program probandocosas(input,output); type t_matriz = array [1..5,1..5] of integer; var matriz: t_matriz; i:integer VALUE 1; cont:integer VALUE 1; a:integer VALUE 1; b:integer VALUE 1; begin while cont<=5 do begin writeln('fila ',cont,':'); while i<=1 to 5 do begin writeln('Inserte el valor ',i); readln(matriz[cont,i]); i:=i+1; end; i:=1; cont:=cont+1; end; writeln('Su matriz es:'); while a<=5 do begin while b<= 5 do begin write(matriz[a,b],' '); b:=b+1; end; writeln; b:=1; a:=a+1; end; writeln('Pulse <enter> para salir:');readln; end. |