const n=20;
var a:array[1..n] of integer;
i,j,c:integer;
begin
randomize;
for i:=1 to n do begin
a[i]:=random(100);
writeln('a[',i,']=',a[i]);
end;
while (a[i] mod 2 <> 0) do begin
c += 1;
for j:=i to n-1 do begin
a[j]:=a[j+1];
a[j+1]:=0;
writeln('Размер массива: ',n-c);
for i:=1 to n-c do begin
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n=20;
var a:array[1..n] of integer;
i,j,c:integer;
begin
randomize;
for i:=1 to n do begin
a[i]:=random(100);
writeln('a[',i,']=',a[i]);
end;
for i:=1 to n do begin
while (a[i] mod 2 <> 0) do begin
c += 1;
for j:=i to n-1 do begin
a[j]:=a[j+1];
a[j+1]:=0;
end;
end;
end;
writeln('Размер массива: ',n-c);
for i:=1 to n-c do begin
writeln('a[',i,']=',a[i]);
end;
end.