porque no me corren los datos correctamente
Publicado por
paola (1 intervención) el 18/03/2008 03:30:07
Program ordenar;
uses wincrt;
var
a,b,c,d:integer;
begin
writeln('Ingrese 4 números');
readln(a,b,c,d);
{Comparación para el mayor}
if a>b then
if a>c then
if a>d then
writeln('Primero ',a);
if b>c then
if b>d then
writeln('Segundo ',b);
if c>d then
writeln('Tercero ',c);
if c>d then
writeln('Cuarto ',d)
else
if c>b then
if c>d then
writeln('segundo',c);
if b>d then
writeln('Tercero ',b);
if b>d then
writeln('Cuarto ',d)
else
if d>b then
if d>c then
writeln('segundo',d);
if b>c then
writeln('Tercero ',b);
if b>c then
writeln('Cuarto ',c);
if b>a then
if b>c then
if b>d then
writeln('Primero ',b);
if a>c then
if a>d then
writeln('Segundo ',a);
if c>d then
writeln('Tercero ',c);
if c>d then
writeln('Cuarto ',d)
else
if c>a then
if c>d then
writeln('segundo',c);
if a>d then
writeln('Tercero ',b);
if a>d then
writeln('Cuarto ',a)
else
if d>a then
if d>c then
writeln('segundo',d);
if a>c then
writeln('Tercero ',a);
if a>c then
writeln('Cuarto ',c);
if c>a then
if c>b then
if c>d then
writeln('Primero ',c);
if a>b then
if a>d then
writeln('Segundo ',a);
if b>d then
writeln('Tercero ',b);
if b>d then
writeln('Cuarto ',d)
else
if b>a then
if b>d then
writeln('segundo',b);
if a>d then
writeln('Tercero ',a);
if a>d then
writeln('Cuarto ',d)
else
if d>a then
if d>b then
writeln('segundo',d);
if a>b then
writeln('Tercero ',a);
if a>b then
writeln('Cuarto ',b);
if d>a then
if d>b then
if d>c then
writeln('Primero ',d);
if a>b then
if a>c then
writeln('Segundo ',a);
if b>c then
writeln('Tercero ',b);
if b>c then
writeln('Cuarto ',c)
else
if b>a then
if b>c then
writeln('segundo',b);
if a>c then
writeln('Tercero ',a);
if a>c then
writeln('Cuarto ',c)
else
if c>a then
if c>b then
writeln('segundo',c);
if b>a then
writeln('Tercero ',b);
if b>a then
writeln('Cuarto ',a);
end.
{ if b>a then
if b>c then
if b>d then
writeln('Mayor ',b);
if a>c then
if a>d then
writeln('Segundo ',a);
if c>d then
writeln('Tercero ',c);
if d>c then
writeln('Cuarto ',d);
if c>a then
if c>b then
if c>d then
writeln('Primero ',c);
if a>b then
if a>d then
writeln('Segundo ',a);
if b>d then
writeln('Tercero ',b);
if d>b then
writeln('Cuarto ',d);
if d>a then
if d>b then
if d>c then
writeln('Primero ',d);
if a>c then
if a>b then
writeln('Segundo ',a);
if b>c then
writeln('Tercero ',b);
if c>b then
writeln('Cuarto ',c);
end. }