Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > Lazarus, FreePascal, Kylix, etc.
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #16  
Antiguo 15-01-2012
RadamantiS RadamantiS is offline
Registrado
NULL
 
Registrado: ene 2012
Posts: 8
Poder: 0
RadamantiS Va por buen camino
Código Delphi [-]
CONST
  max=10;
  mm=10;
TYPE
  matriz=ARRAY[1..mm,1..max] OF integer;
VAR  {Estas son las variables del programa principal}
  mat,mat1,mat2:matriz;
  lado_i,lado_j:integer;
  i,j:integer;
  n_mayor,n_menor:integer;
  p_mayor,p_menor:ARRAY[1..2] OF integer;                

procedure mayor_menor_matriz(var n_mayor,n_menor:integer);
var
mat:matriz;
begin
leer_matriz(lado_i,lado_j,mat);
FOR i:=1 TO mm DO
n_mayor:=mat[1,1];
n_menor:=mat[1,1];
FOR i:=1 TO mm DO
FOR j:=1 TO max DO
IF mat[i,j]>n_mayor THEN
begin
n_mayor:=mat[i,j];
p_mayor[2]:=j;
p_mayor[1]:=i;
end;
IF mat[i,j]THEN
begin
n_menor:=mat[i,j];
p_menor[2]:=j;
p_menor[1]:=i;
end;
writeln ('El menor elemento es ',n_menor);
writeln ('El mayor es ',n_mayor);
readln;
end;

procedure intercambio_matriz(var n_mayor,n_menor:integer;mat:matriz);
var
nmenor,nmayor:integer;
i,j:integer;
mat_inter:matriz;
begin
mat_inter:=mat;
mayor_menor_matriz(n_mayor,n_menor);
nmenor:=n_menor;
nmayor:=n_mayor;
FOR i:=1 TO lado_i DO
FOR j:=1 TO lado_j DO
begin
IF nmenor=mat[i,j] THEN mat_inter[i,j]:=nmayor;
IF nmayor=mat[i,j] THEN mat_inter[i,j]:=nmenor;
end;
Mostrar_matriz (mat_inter,lado_i,lado_j);
readln;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Comparativa entre Free Pascal 2.2.0 y Turbo Pascal 7.0 esocrates Varios 2 14-07-2008 14:56:24
crear un programa tipo pascal que funcione con el disco de inicio ms-dos kurono Varios 5 14-03-2008 22:28:17
Calculadora sebaguillen Varios 17 28-08-2007 15:27:23
Calculadora Epunamun OOP 3 19-12-2005 22:33:11
manual de excepciones de object pascal para free pascal??? Garion OOP 3 27-05-2005 00:42:29


La franja horaria es GMT +2. Ahora son las 19:15:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi