4)var i,min,max,count,j:integer;
a:array[1..40] of integer;
begin
min:=500;
max:=10;
for i:=1 to 40 do
a[i]:=random(10,500);
for i:=1 to 40 do
begin
if a[i]>max then
max:=a[i];
if a[i]begin
min:=a[i];
count:=i;
end;
for j:= 1 to 40 do
if (i<>j) and (a[i]=a[j]) then
writeln('Элементы',i,'и',j,'содержат число',a[i])
end;
writeln('Самое большое числа',max);
writeln('Номер самого маленького числа',count);
end.
5)
var i,j:integer;
k:real;
a:array[1..10] of real;
begin
writeln('Пункт a');
for i:= 1 to 10 do
begin
a[i]:=sin(i/10)*30;
writeln(a[i]);
end;
writeln('Пункт b');
for i:= 1 to 9 do
for j:=1 to 10-i do
if a[j]>a[j+1] then
begin
k:=a[j];
a[j] := a[j+1];
a[j+1]:= k;
end;
for i := 1 to 10 do
writeln(a[i]);
writeln('Пункт c');
for i := 1 to 10 do
if i mod 3 <>0 then
writeln(a[i])
else if i mod 3 = 0 then
begin
a[i]:=a[i]*7;
writeln(a[i]);
end;
writeln('Пункт d');
for i:=1 to 10 do
for j:=1 to 10 do
if a[i]>a[j] then
swap(a[i],a[j]);
for j := 1 to 10 do
writeln(a[j]);
writeln('Пункт e');
for j:= 1 to 10 do
writeln(round(a[j]*100)/100);
end.