Нужна блок-схема нарисованная. var i, j, n, min: integer; v: array[1..8]of integer; p: array[1..8]of integer; s: array[1..8]of integer; begin min := 999; for i := 1 to 8 do read(v[i]); for i := 1 to 8 do read(p[i...
Нужна блок-схема нарисованная.
var
i, j, n, min: integer;
v: array[1..8]of integer;
p: array[1..8]of integer;
s: array[1..8]of integer;
begin
min := 999;
for i := 1 to 8 do read(v[i]);
for i := 1 to 8 do read(p[i]);
for i := 1 to 8 do read(s[i]);
for i := 1 to 8 do if(p[i] = 0) and (s[i] = 1) and (v[i] < min) then min := v[i];
write(min);
end.
Ответ(ы) на вопрос:
Гость
program massiv_zamena_min_max;
uses crt;
var massiv: array [1..100,1..100] of integer;
i,j,mr,mc,min, max, minj, maxj, tmp:integer;
begin
clrscr;
mr:=101;
mc:=101;
while ((mr>100)or(mr<0)or(mc>100)or(mc<0)) do
begin
writeln('Vvedite razmernost massiva (ne bolee chem 100x100):');
readln(mr);
readln(mc);
end;
for i:=1 to mr do
for j:=1 to mc do
begin
writeln('Vvedite element massiva nomer ',(i-1)*mc+j,':');
readln(massiv[i,j]);
end;
writeln('Massiv do izmeneniya:');
for i:=1 to mr do
begin
for j:=1 to mc do write(massiv[i,j],' ');
writeln;
end;
min:=massiv[1,1];
minj:=1;
for i:=1 to mr do
for j:=1 to mc do
if massiv[i,j]begin
min:=massiv[i,j];
minj:=j;
end;
max:=massiv[1,1];
maxj:=1;
for i:=1 to mr do
for j:=1 to mc do
if massiv[i,j]>max then
begin
maX:=massiv[i,j];
maxj:=j;
end;
for i:=1 to mr do
begin
tmp:=massiv[i,minj];
massiv[i,minj]:=massiv[i,maxj];
massiv[i,maxj]:=tmp;
end;
writeln('Nomer ctolbca s minimalnym elementom: ',minj);
writeln('Nomer ctolbca s maximalnym elementom: ',maxj);
writeln('Massiv posle izmeneniya:');
for i:=1 to mr do
begin
for j:=1 to mc do write(massiv[i,j],' ');
writeln;
end;
readln;
end. Это решение
Не нашли ответ?
Похожие вопросы