[Turbo Pascal] Wyświetlanie posortowanych liczb
: 8 lis 2014, o 12:57
Witam,
Posiadam taki kod:
Mój problem polega na tym , że nie wiem jak przerobić ten program żeby po wpisaniu 3 liczb wyświetlał je od największej do najmniejszej.
Posiadam taki kod:
Kod: Zaznacz cały
program testowy;
uses crt;
var a,b,c:integer;
begin
clrscr;
writeln('Podaj trzy liczby');readln(a,b,c);
begin
if (a>b) and (a>c) then writeln(a);
if (b>a) and (b>c) then writeln(b);
if (c>a) and (c>b) then writeln(c);
end;
begin
if (a<b) and (a<c) then writeln(a);
if (b<a) and (b<c) then writeln(b);
if (c<a) and (c<b) then writeln(c);
end;
readkey;
end.