var a: array[1..MAX_SIZE] of integer; i, size: integer;
procedure delete_odd_elements(); var i, j: integer; begin i := 1; repeat if odd(a[i]) then begin dec(size); for j := i to size do a[j] := a[j + 1] end else inc(i); until i > size; end;
begin writeln('Исходный массив: '); size := MAX_SIZE; for i := 1 to size do begin a[i] := random(100); write(a[i] : 3); end; delete_odd_elements; writeln; writeln('Полученный массив: '); for i := 1 to size do write(a[i] : 3); end.
MAX_SIZE = 10;
var
a: array[1..MAX_SIZE] of integer;
i, size: integer;
procedure delete_odd_elements();
var i, j: integer;
begin
i := 1;
repeat
if odd(a[i]) then
begin
dec(size);
for j := i to size do
a[j] := a[j + 1]
end
else inc(i);
until i > size;
end;
begin
writeln('Исходный массив: ');
size := MAX_SIZE;
for i := 1 to size do
begin
a[i] := random(100);
write(a[i] : 3);
end;
delete_odd_elements;
writeln;
writeln('Полученный массив: ');
for i := 1 to size do
write(a[i] : 3);
end.
Var i:integer;
begin
for i:=100 to 999 do if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
end.
{While}
Var i:integer;
begin
i:=100;
while i<=999 do begin
if( if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' '); inc(i); end;
end.
{Repeat}
Var i:integer;
begin
i:=100;
repeat
begin
if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
inc(i); end;
until i<1000;
end.