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.
uses crt; var s:string; c:char; m:set of char; n,i,k,p:byte; begin writeln('Введите текст из строчных латинских букв, окончаание ввода Enter'); s:=''; repeat c:=readkey; if c in ['a'..'z'] then begin write(c); s:=s+c; end; if c=#13 then writeln until c=#13; n:=length(s); m:=[]; for c:='a' to 'z' do begin k:=0; for i:=1 to n do if s[i]=c then k:=k+1; if k>1 then m:=m+[c]; end; if m=[] then write('Нет букв, встречающихся более 1 раза') else for c:='a' to 'z' do if c in m then write(c) 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.