uses
SysUtils;
var
elki, elkiOverSize: array[1..50] of Integer;
i,j: Integer;
begin
randomize();
j:=0;
for i := 1 to 50 do
elki[i] := random(170-45+1)+45;
if elki[i] = 160 then
elkiOverSize[j] := i;
inc(j);
end;
write('Оригинальный массив: ');
write(IntToStr(elki[i])+' ');
writeln();
write('Индексы ёлок равных 160: ');
if elkiOverSize[i] <> 0 then
write(IntToStr(elkiOverSize[i])+' ');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
uses
SysUtils;
var
elki, elkiOverSize: array[1..50] of Integer;
i,j: Integer;
begin
randomize();
j:=0;
for i := 1 to 50 do
begin
elki[i] := random(170-45+1)+45;
if elki[i] = 160 then
begin
elkiOverSize[j] := i;
inc(j);
end;
end;
write('Оригинальный массив: ');
for i := 1 to 50 do
begin
write(IntToStr(elki[i])+' ');
end;
writeln();
writeln();
write('Индексы ёлок равных 160: ');
for i := 1 to 50 do
begin
if elkiOverSize[i] <> 0 then
write(IntToStr(elkiOverSize[i])+' ');
end;
writeln();
end.