uses crt;
const
n=10; m=10;
var t,i,j,ch,k: integer;
mas,nmas: array [1..100,1..100] of integer;
mas2: array[1..100] of boolean;
begin
clrscr;
randomize;
for i:=1 to n do
for j:=1 to m do
mas[i,j]:=random(100);
writeln('Vvedite chislo');
readln(ch);
for i:=1 to n do
for j:=1 to m do
if mas[i,j]=ch then mas2[i]:=true;
t:=0;
for i:=1 to n do begin
if mas2[i]=false then begin t:=t+1;
for k:=1 to m do
nmas[t,k]:=mas[i,k]; end;
end;
writeln('ORIGINAL masiv');
for i:=1 to n do begin
for j:=1 to m do
write(mas[i,j],' ');
writeln;
end;
writeln('NEW masiv');
for i:=1 to t do begin
for j:=1 to m do
write(nmas[i,j],' ');
writeln;
end;
readln;
end.
uses crt;
const
n=10; m=10;
var t,i,j,ch,k: integer;
mas,nmas: array [1..100,1..100] of integer;
mas2: array[1..100] of boolean;
begin
clrscr;
randomize;
for i:=1 to n do
for j:=1 to m do
mas[i,j]:=random(100);
writeln('Vvedite chislo');
readln(ch);
for i:=1 to n do
for j:=1 to m do
if mas[i,j]=ch then mas2[i]:=true;
t:=0;
for i:=1 to n do begin
if mas2[i]=false then begin t:=t+1;
for k:=1 to m do
nmas[t,k]:=mas[i,k]; end;
end;
writeln('ORIGINAL masiv');
for i:=1 to n do begin
for j:=1 to m do
write(mas[i,j],' ');
writeln;
end;
writeln('NEW masiv');
for i:=1 to t do begin
for j:=1 to m do
write(nmas[i,j],' ');
writeln;
end;
readln;
end.
uses crt;
const
n: integer = 10;
m = 10;
var
i, j, k, ch: integer;
mas: array[1 .. 100, 1 .. 100] of integer;
found: boolean;
begin
clrscr;
randomize;
for i:=1 to n do
for j:=1 to m do mas[i,j]:=random(100);
writeln('ORIGINAL masiv');
for i:=1 to n do begin
for j:=1 to m do
write(mas[i,j]:4);
writeln;
end;
writeln('Vvedite chislo');
readln(ch);
i := 1;
while i <= n do begin
found := false;
for j := 1 to m do
if mas[i, j] = ch then found := true;
if found then begin
for j := 1 to m do
for k := i to n - 1 do mas[k, j] := mas[k + 1, j];
dec(n);
end
else inc(i);
end;
writeln('NEW masiv');
for i:=1 to n do begin
for j:=1 to m do
write(mas[i,j]:4);
writeln;
end;
readln;
end.