2)
const
handsfree = true;
var
a: array[1..100] of real;
i, n, mini: integer;
begin
{ввод массива}
if handsfree then
n := random(27+27) -27
else begin
write('n = ');
readln(n);
end;
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(100) - 50;
write(a[i], ' ');
end
else readln(a[i]);
end;
writeln();
{минимум и максимум}
mini := 1;
for i := 1 to n do
if a[mini] > a[i] then mini := i;
writeln('min = ', a[mini]);
writeln('mini = ', mini);
end.
1)const
handsfree = false;
var
a: array[1..100] of real;
i, n: integer;
sum, product, harmonic: real;
begin
{ввод массива}
if handsfree then
n := random(20) + 5
else begin
write('n = ');
readln(n);
end;
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(100) - 50;
write(a[i], ' ');
end
else readln(a[i]);
end;
writeln();
{подсчет суммы и произведения и агригатов}
sum := 0;
for i := 1 to n do
if abs(a[i]) <= 5 then<br> sum := sum + a[i];
writeln('sum = ', sum);
end.