Ответ:
var
a:array[1..12] of integer;
i:integer;
begin
randomize;
writeln(‘Сгенерированный массив:’);
for i := 1 to 12 do
begin
a[i] := random(36) — 15;
write(a[i], ‘ ‘);
end;
writeln;
end.
//вторая программа
const
n = 8;
var
a:array[1..n] of integer;
i, count3, count4, count5:integer;
begin
randomize;
writeln(‘Оценки учеников:’);
for i := 1 to n do
begin
a[i] := random(3) + 3;
write(a[i], ‘ ‘);
if a[i] = 5 then
inc(count5);
if a[i] = 4 then
inc(count4);
if a[i] = 3 then
inc(count3);
end;
writeln;
writeln(‘Троек — ‘, count3);
writeln(‘Четверок — ‘, count4);
writeln(‘Пятерок — ‘, count5);
end.
//третья программа
var
k:array[1..12] of integer;
i:integer;
begin
randomize;
writeln(‘Сгенерированный массив:’);
for i := 1 to 12 do
begin
k[i] := random(36) — 15;
write(k[i], ‘ ‘);
end;
writeln;
writeln(‘Преобразованный массив:’);
for i := 1 to 12 do
begin
k[i] := k[i] * (-1);
write(k[i], ‘ ‘);
end;
end.