program p1;
uses crt;
const N = 30;
var a:array[1..N] of integer;
i,b,k:integer;
begin
for i:=1 to N do begin Вывод рандомных элементов
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
readln(b);
for i:=1 to N do begin
if b<>a[i] then begin ( если b не равно эл массива то
k:=k+1; (счётчик)
write(a[i]:4); (вывод))
writeln(k);
end.
var a: array [1..5, 1..7] of integer;
i,j,max,min: integer;
for i:=1 to 5 do
for j:=1 to 7 do
A[i,j]:=random(100);
max:=-1;
min:=101;
for i:=1 to 5 do begin
write(A[i,j]:5);
writeln();
if A[i,j]>max then max:=A[i,j];
if A[i,j]<min then min:=A[i,j];
for j:=1 to 7 do begin
if A[i,j]=max then A[i,j]:=min
else if A[i,j]=min then A[i,j]:=max;
program p1;
uses crt;
const N = 30;
var a:array[1..N] of integer;
i,b,k:integer;
begin
for i:=1 to N do begin Вывод рандомных элементов
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
readln(b);
for i:=1 to N do begin
if b<>a[i] then begin ( если b не равно эл массива то
k:=k+1; (счётчик)
write(a[i]:4); (вывод))
end;
end;
writeln;
writeln(k);
end.
var a: array [1..5, 1..7] of integer;
i,j,max,min: integer;
begin
for i:=1 to 5 do
for j:=1 to 7 do
A[i,j]:=random(100);
max:=-1;
min:=101;
for i:=1 to 5 do begin
for j:=1 to 7 do
write(A[i,j]:5);
writeln();
end;
for i:=1 to 5 do
for j:=1 to 7 do
if A[i,j]>max then max:=A[i,j];
for i:=1 to 5 do
for j:=1 to 7 do
if A[i,j]<min then min:=A[i,j];
for i:=1 to 5 do
for j:=1 to 7 do begin
if A[i,j]=max then A[i,j]:=min
else if A[i,j]=min then A[i,j]:=max;
end;
writeln();
for i:=1 to 5 do begin
for j:=1 to 7 do
write(A[i,j]:5);
writeln();
end;
end.