Arrange 3 numbers - descending

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Category: Homework in Pascal

Author: Juraj Pupák
Program: Cislo3.pas
File exe: Cislo3.exe
File ubuntu: Cislo3

Arrange 3 numbers - descending.
{ CISLO3.PAS                                                        }
{ Usporiadanie 3 cisel.                                             }
{                                                                   }
{ Author: Juraj Pupak                                               }
{ Date  : 27.10.2006                           http://www.trsek.com }
 
program cislo;
uses crt;
var
 a,b,c,max_num:integer;
begin
 clrscr;
 writeln('Porovnanie 3 cisel');
 writeln('------------------');
 writeln('Zadaj prve cislo');
 readln(a);
 writeln('Zadaj druhe cislo');
 readln(b);
 writeln('Zadaj tretie cislo');
 readln(c);
 clrscr;
 
 IF (a > b) and (b > c) THEN
   begin
     writeln('Najvacsie cislo je ',a,'. Druhe cislo je ',b,'. Najmensie cislo je ',c,'.');
   end;
 IF (b > a) and (a > c) THEN
   begin
     writeln('Najvacsie cislo je ',b,'. Druhe cislo je ',a,'. Najmensie cislo je ',c,'.');
   end;
 IF (c > a) and (a > b) THEN
   begin
     writeln('Najvacsie cislo je ',c,'. Druhe cislo je ',a,'. Posledne cislo je ',b,'.');
   end;
 IF (c > b) and (b > a) THEN
   begin
     writeln('Najvacsie cislo je ',c,'. Druhe cislo je ',b,'. Posledne cislo je ',a,'.');
   end;
 IF (a > c) and (c > b) THEN
   begin
     writeln('Najvacsie cislo je ',a,'. Druhe cislo',c,'. Posledne cislo',b,'.');
   end;
 IF (b > c) and (c > a) THEN
   begin
     writeln('Najvacsie cislo je ',b,'. Druhe cislo je ',c,'. Posledne cislo je ',a,'.');
   end;
 readln;
end.