Составьте блок-схему алгоритма и алгоритм на алгоритмическом языке «Проезд регулируемого перекрестка». Какие алгоритмические конструкции использует эта блок схема?
var n,m,i,s1,s2:integer; p1,p2,p:real; a,b:array[1..10] of integer; begin write('n=');read(n); write('m=');read(m);writeln; for i:=1 to n do begin write('a[',i,']= '); readln(a[i]); end; for i:=1 to m do begin write('b[',i,']= '); readln(b[i]); end;writeln; s1:=0; for i:=1 to n do s1:=s1+a[i]; p1:=s1/n; p1:=int(p1); writeln('Srednee arifmeticheskoe massiva A=',p1); s2:=0; for i:=1 to m do s2:=s2+b[i]; p2:=s2/m;p2:=int(p2); writeln('Srednee arifmeticheskoe massiva B=',p2); p:=p1+p2; if p1=p2 then write('A=B') else begin if p1>p2 then write('A>B') else write('A<B'); end; end.
var a:array[1..1000,1..1000] of integer; i,j,n,m,min,k,k1,str:integer; begin writeln('Vvedite razmernost massiva NxM'); readln(n); readln(m); for i:= 1 to n do begin for j:= 1 to m do begin write('a[',i,',',j,']:='); read(a[i,j]); end; end; min:=a[1,1]; for i:=1 to n do for j:=1 to m do begin if a[i,j]<min then begin min:=a[i,j]; end; end; k:=0; for i:=1 to n do begin for j:=1 to n do begin if a[i,j]=min then k1:=k1+1; end; if k1>k then begin k:=k1; str:=i; end; end; writeln('Stroka s max kolich min elementov: ',str); for i:=1 to n do begin for j:=1 to m do write(a[i,j]:10); writeln;
var n,m,i,s1,s2:integer;
p1,p2,p:real;
a,b:array[1..10] of integer;
begin
write('n=');read(n);
write('m=');read(m);writeln;
for i:=1 to n do begin
write('a[',i,']= ');
readln(a[i]);
end;
for i:=1 to m do begin
write('b[',i,']= ');
readln(b[i]);
end;writeln;
s1:=0;
for i:=1 to n do s1:=s1+a[i];
p1:=s1/n; p1:=int(p1);
writeln('Srednee arifmeticheskoe massiva A=',p1);
s2:=0;
for i:=1 to m do
s2:=s2+b[i];
p2:=s2/m;p2:=int(p2);
writeln('Srednee arifmeticheskoe massiva B=',p2);
p:=p1+p2;
if p1=p2 then write('A=B') else begin
if p1>p2 then write('A>B') else write('A<B');
end;
end.
var a:array[1..1000,1..1000] of integer;
i,j,n,m,min,k,k1,str:integer;
begin
writeln('Vvedite razmernost massiva NxM');
readln(n);
readln(m);
for i:= 1 to n do
begin
for j:= 1 to m do begin
write('a[',i,',',j,']:=');
read(a[i,j]);
end;
end;
min:=a[1,1];
for i:=1 to n do
for j:=1 to m do
begin
if a[i,j]<min then
begin
min:=a[i,j];
end;
end;
k:=0;
for i:=1 to n do
begin
for j:=1 to n do
begin
if a[i,j]=min then
k1:=k1+1;
end;
if k1>k then
begin
k:=k1;
str:=i;
end;
end;
writeln('Stroka s max kolich min elementov: ',str);
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:10);
writeln;
end;
end.