8 apellido: string[30];
\r
9 telefono: string[20];
\r
12 matriz = array[1..max, 1..max] of persona;
\r
15 (***********************************************************************)
\r
17 procedure Rotar90Matriz( var mat: matriz; mn, mx: integer );
\r
20 vector = array[1..max] of persona;
\r
29 for i := mn to mx - 1 do
\r
30 vtemp[i] := mat[mn,i];
\r
31 for i := mn to mx - 1 do
\r
32 mat[mn,i] := mat[i,mx];
\r
33 for i := mn + 1 to mx do
\r
34 mat[mx+1-i,mx] := mat[mx,i];
\r
35 for i := mn + 1 to mx do
\r
36 mat[mx,i] := mat[i,mn];
\r
37 for i := mn to mx - 1 do
\r
38 mat[mx+1-i,mn] := vtemp[i];
\r
39 Rotar90Matriz( mat, mn + 1, mx - 1 );
\r
43 (***********************************************************************)
\r
45 procedure MostrarMatriz( var mat: matriz; tope: integer);
\r
51 for i := 1 to tope do
\r
53 for j := 1 to tope do
\r
54 write( ' (', mat[i,j].apellido, ', ', mat[i,j].telefono, ') ' );
\r
59 (***********************************************************************)
\r
61 procedure CargarMatriz( var mat: matriz; tope: integer );
\r
67 for i := 1 to tope do
\r
68 for j := 1 to tope do
\r
70 write( 'Ingrese el nobre: ' );
\r
71 readln( mat[i,j].apellido );
\r
72 write( 'Ingrese el telefono: ' );
\r
73 readln( mat[i,j].telefono );
\r
77 (***********************************************************************)
\r
85 write( 'Ingrese el tama¤o de la matriz (', max : 1, ' m ximo): ' );
\r
89 writeln( 'El n£mero que ingres¢ es muy grande, el m ximo es ', max : 1 );
\r
90 write( ' Ingrese otro n£mero: ' );
\r
93 CargarMatriz( mat, n );
\r
96 MostrarMatriz( mat, n );
\r
97 Rotar90Matriz( mat, 1, n );
\r