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

Урок 9 — If

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

program maxOf4;
var a,b,c,d,x,y: integer;
begin;
  writeln('what is nums a, b, c, d ?: ');
  read(a,b,c,d);
    if (a>b) then
       x:=a
    else if (a<b) then
       x:=b;
    if (c>d) then
       y:=c
    else if (c<d) then
       y:=d;
    if (x>y) then
          writeln('max of a, b, c, d is ', x)
    else
          writeln('max of a, b, c, d is ', y);
      readln();        readln();
end.  
vedro-compota's picture

решите через вложенные блоки if

_____________
матфак вгу и остальная классика =)