Const n=20; var a:array[1..n]of integer; i,b,k,c,f,g,h:integer; begin for i:=1 to n do a[i]:=Random(70)-20; for i:=1 to n do write(a[i],' '); writeln; for i:=1 to n do begin if (a[i] mod 5 = 0) and (a[i] mod 10<>0) or (a[i]=50) then begin b:=i; for b:=i to (n-1) do a[i]:=a[i+1]; end; end; for i:=1 to n do write(a[i],' '); write('введите к '); read(k); for i:=1 to n do begin if a[i] mod i = 0 then begin c:=i; for i:=n downto c+1 do begin a[i]:=a[i-1]; a[c+1]:=k; end;end;end; for i:=1 to n do write(a[i],' '); writeln; f:=0; g:=0; for i:=n downto 1 do begin if (a[i]>0) then f:=i; end; if a[f]=0 then write('нет положительных '); for i:=n downto 1 do begin if (a[i]<0) then g:=i; end; if (a[g]=0) then write('нет отрицательных '); if (a[f]<>0) and (a[g]<>0) then begin h:=a[f]; a[f]:=a[g]; a[g]:=h; end; for i:=1 to n do write(a[i],' '); writeln; end.
var
nm,snm:array of string;
age:array of integer;
k,s:integer;
begin
write('Введите общее кол-во студентов - '); readln(k);
setLength(nm,k); setLength(snm,k); setLength(age,k);
for var i1:=0 to k-1 do begin
writeln('[Студент ',i1+1,']');
write('Имя - '); readln(nm[i1]);
write('Фамилия - '); readln(snm[i1]);
write('Возраст - '); readln(age[i1]);
end;
for var i2:=0 to k-1 do
if age[i2]<16 then s:=s+1;
writeln; writeln('Кол-во студентов которым меньше 16 лет = ',s,' человек:');
for var i2:=0 to k-1 do begin
if age[i2]<16 then writeln(nm[i2],' ',snm[i2],' ',age[i2],' лет');
end;
end.
var a:array[1..n]of integer;
i,b,k,c,f,g,h:integer;
begin
for i:=1 to n do a[i]:=Random(70)-20;
for i:=1 to n do
write(a[i],' ');
writeln;
for i:=1 to n do begin
if (a[i] mod 5 = 0) and (a[i] mod 10<>0) or (a[i]=50) then begin
b:=i;
for b:=i to (n-1) do
a[i]:=a[i+1];
end; end;
for i:=1 to n do
write(a[i],' ');
write('введите к ');
read(k);
for i:=1 to n do begin
if a[i] mod i = 0 then begin
c:=i;
for i:=n downto c+1 do begin
a[i]:=a[i-1];
a[c+1]:=k;
end;end;end;
for i:=1 to n do
write(a[i],' ');
writeln;
f:=0; g:=0;
for i:=n downto 1 do begin
if (a[i]>0) then f:=i;
end;
if a[f]=0 then write('нет положительных ');
for i:=n downto 1 do begin
if (a[i]<0) then g:=i;
end;
if (a[g]=0) then write('нет отрицательных ');
if (a[f]<>0) and (a[g]<>0) then begin
h:=a[f]; a[f]:=a[g]; a[g]:=h; end;
for i:=1 to n do
write(a[i],' ');
writeln;
end.