const nx = 20; var x: array[1..nx, 1..nx] of integer;z:array[1..nx*2] of integer; i, j, k,n,r,t: integer; begin Writeln('Введите размер матрицы n');Read(n); for i := 1 to n do begin for j := 1 to n do begin Read(k);x[i, j] := k; end;end; Writeln('Исходный массив'); for i := 1 to n do begin for j := 1 to n do begin Write(x[i, j]:4); if x[i, j]>0 then begin t:=t+1; z[t]:=x[i, j];end; end; Writeln; end; Writeln;Writeln('Одномерный массив'); for j := 1 to t do Write(z[j]:4); 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.
var x: array[1..nx, 1..nx] of integer;z:array[1..nx*2] of integer;
i, j, k,n,r,t: integer;
begin
Writeln('Введите размер матрицы n');Read(n);
for i := 1 to n do begin
for j := 1 to n do begin
Read(k);x[i, j] := k; end;end;
Writeln('Исходный массив');
for i := 1 to n do begin
for j := 1 to n do begin
Write(x[i, j]:4);
if x[i, j]>0 then begin t:=t+1; z[t]:=x[i, j];end;
end;
Writeln; end;
Writeln;Writeln('Одномерный массив');
for j := 1 to t do
Write(z[j]:4);
end.