Program maxmin; var l,i,n,min,max:integer; begin read(n); for i:=1 to n do begin max:=0; min:=10; read(l); if l<min then min:=l; if l>max then max:=l; end; writeln(max*min); end.
Program fofgogjoj; var arr: array[1..1000] of byte; max_num, min_num: byte; i: byte; n,p:integer; begin randomize; Wriiteln('Введите число n'); Readln(n); for i := 1 to n do begin arr[i] := random(100); Write (arr[i]:3); end; max_num := arr[1]; for i := 2 to n do if arr[i] > max_num then begin max_num := arr[i]; end; Writeln; Writeln ('Max = ',max_num); min_num := arr[1]; for i := 2 to n do if arr[i] < min_num then begin min_num := arr[i]; end; Writeln; Writeln ('Min = ',min_num); P:=max_num*min_num; Writeln('Произведение равно:',p); end.
var l,i,n,min,max:integer;
begin
read(n);
for i:=1 to n do begin
max:=0;
min:=10;
read(l);
if l<min then min:=l;
if l>max then max:=l;
end;
writeln(max*min);
end.
to?
var
arr: array[1..1000] of byte;
max_num, min_num: byte;
i: byte;
n,p:integer;
begin
randomize;
Wriiteln('Введите число n');
Readln(n);
for i := 1 to n do begin
arr[i] := random(100);
Write (arr[i]:3);
end;
max_num := arr[1];
for i := 2 to n do
if arr[i] > max_num then
begin
max_num := arr[i];
end;
Writeln;
Writeln ('Max = ',max_num);
min_num := arr[1];
for i := 2 to n do
if arr[i] < min_num then
begin
min_num := arr[i];
end;
Writeln;
Writeln ('Min = ',min_num);
P:=max_num*min_num;
Writeln('Произведение равно:',p);
end.