Программа:
var a,b,c,max: integer;
begin
randomize;
a:=random(61)-30;
b:=random(61)-30;
c:=random(61)-30;
writeln('a = ',a,' b = ',b,' c = ',c);
if abs(a)>abs(b) then max:=a else max:=b;
if abs(c)>abs(max) then max:=c;
writeln('max = ',max);
end.
Пример:
a = 26 b = -25 c = -2
max = 26
Программа:
var a,b,c,max: integer;
begin
randomize;
a:=random(61)-30;
b:=random(61)-30;
c:=random(61)-30;
writeln('a = ',a,' b = ',b,' c = ',c);
if abs(a)>abs(b) then max:=a else max:=b;
if abs(c)>abs(max) then max:=c;
writeln('max = ',max);
end.
Пример:
a = 26 b = -25 c = -2
max = 26