Задача 7 урок 9

Задача 7 урок 9

Пользователь вводит четыре числа, найдите из них максимальное.

program zadacha7;
 var a, b, c, d : integer;     //объявляем переменные
   d1,d2,d3,d4 : boolean;
   begin
    writeln('Vvedite chidlo A:');
    readln(a);                       //вводим переменные
    writeln('Vvedite chidlo B:');
    readln(b);
    writeln('Vvedite chidlo C:');
    readln(c);
    writeln('Vvedite chidlo D:');
    readln(d);
    d1:=(a>b) and (a>c) and (a>d);    //cравниваем числа между собой
    d2:=(b>a) and (b>c) and (b>d);
    d3:=(c>a) and (c>b) and (c>d);
    d4:=(d>a) and (d>b) and (d>c);
     if d1=true then                        //порверяем наибольшее
     writeln ('Naibolshee chislo: ', a);
       if d2=true then
       writeln ('Naibolshee chislo: ', b);
        if d3=true then
        writeln ('Naibolshee chislo: ', c);
         if d4=true then
         writeln ('Naibolshee chislo: ', d);
    readln();
   end.