Решение 3 Задача 6 Урок 9

Урок 9

Пользователь вводит три числа, найдите из них максимальное.
Без вложенных блоков (без and) -- запомнив максимум из двух
в специальной переменной.

var a, b, c, k: integer;

begin

  writeln('Vvedite pervoe chislo (int) A =');
  readln(a);
  writeln('Vvedite vtoroe chislo (int) B =');
  readln(b);
  writeln('Vvedite tretye chislo (int) C =');
  readln(c);


  if (a > b) then
     begin
          k := a;
     end
  else if (a < b) then
      begin
           k := b;
      end;

  if (c > k) then
       begin
            writeln(c, ' - maximalnoe chislo');
       end
   else
       begin
            writeln(k, ' -  maximalnoe chislo');
       end;

  readln();

end.

КОНСОЛЬ

Vvedite pervoe chislo (int) A =
100
Vvedite vtoroe chislo (int) B =
200
Vvedite tretye chislo (int) C =
300
300 - maximalnoe chislo
vedro-compota's picture

решение засчитано

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