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

Задача 7 Урок 9:

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

var
a,b,c,d,max,max1,max2,max3:integer;
begin
     writeln('Vedite chislo a');
     readln(a);
     writeln('Vedite chislo b');
     readln(b);
     writeln('Vedite chislo c');
     readln(c);
     writeln('Vedite chislo d');
     readln(d);
     if (a>b)then
        max1:=a
     else
        max1:=b;
     if (max1>c)then
        max2:=max1
     else
        max2:=c;
     if (max2>d)then
        max3:=max2
     else
        max3:=d;
        max:=max3;
     writeln('vivoditsya bolsshee chislo: ',max);
     readln();
end.  

Вывод консоли:

Vedite chislo a
10
Vedite chislo b
1
Vedite chislo c
1
Vedite chislo d
1
vivoditsya bolsshee chislo: 10