Const
n=10;
var i,amin,amax,imin,imax:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do
a[i]:=random(30);
writeln('Полученный массив:');
write(a[i]:4);
writeln;
imax:=1;
imin:=1;
amax:=a[1];
amin:=a[1];
if a[i]>amax then
begin amax:=a[i]; imax:=i end else
begin amin:=a[i]; imin:=i; end;
writeln('A[',imin,']=',a[imin]);
writeln('A[',imax,']=',a[imax]);
end
program fives;
CONST N = 10;
var
a: array [1..N] of integer;
i,imax4,imax4z : integer;
Randomize;
imax4 := 1;
imax4z := a[1];
for i := 1 to N do
a[i] := random(100) + 1;
writeln(a[i]);
end;
if (a[i] mod 4 <> 0) and (a[i]>imax4z) then
imax4z := a[i];
imax4:= i;
writeln('Max:',imax4z);
writeln('Index: ',imax4);
end.
Const
n=10;
var i,amin,amax,imin,imax:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do
a[i]:=random(30);
writeln('Полученный массив:');
for i:=1 to n do
write(a[i]:4);
writeln;
imax:=1;
imin:=1;
amax:=a[1];
amin:=a[1];
for i:=1 to n do
if a[i]>amax then
begin amax:=a[i]; imax:=i end else
begin amin:=a[i]; imin:=i; end;
writeln('A[',imin,']=',a[imin]);
writeln('A[',imax,']=',a[imax]);
end
program fives;
CONST N = 10;
var
a: array [1..N] of integer;
i,imax4,imax4z : integer;
begin
Randomize;
imax4 := 1;
imax4z := a[1];
for i := 1 to N do
begin
a[i] := random(100) + 1;
writeln(a[i]);
end;
for i := 1 to N do
begin
if (a[i] mod 4 <> 0) and (a[i]>imax4z) then
begin
imax4z := a[i];
imax4:= i;
end;
end;
writeln('Max:',imax4z);
writeln('Index: ',imax4);
end.