Задача 7 Урок 9
Primary tabs
Пользователь вводит четыре числа, найдите из них максимальное.
var
a,b,c,d,max:integer;
begin
writeln('Vvedite a,b,c,d: ');
readln(a,b,c,d);
writeln();
if (a > b) and (a > c) and (a > d) then
max:=a;
if (b > a) and (b > c) and (b > d) then
max:=b;
if (c > a) and (c > b) and (c > d) then
max:=c
else
max:=d;
writeln(max);
readln();
end. - Log in to post comments
- 2120 reads
vedro-compota
Sun, 08/08/2021 - 12:07
Permalink
решите через вложенные if
решите через вложенные if
_____________
матфак вгу и остальная классика =)
exotick777
Sun, 08/08/2021 - 15:59
Permalink
Исправлено
Исправлено
var a,b,c,d,max:integer; begin writeln('Vvedite a,b,c,d: '); readln(a,b,c,d); writeln(); if (a > b) and (a > c) and (a > d) then max:=a else if (b > a) and (b > c) and (b > d) then max:=b else if (c > a) and (c > b) and (c > d) then max:=c else max:=d; writeln(max); readln(); end.