1)var a:array[1..3,1..3] of integer; b:array[1..3,1..3] of integer; c:array[1..3,1..3] of integer; i,j:integer; begin; writeln('A array:'); for i:=1 to 3 do begin; writeln; for j:=1 to 3 do begin; a[i,j]:=random(-10,10); write(a[i,j]:4); end; end; writeln; writeln('B array:'); for i:=1 to 3 do begin; writeln; for j:=1 to 3 do begin; b[i,j]:=random(-10,10); write(b[i,j]:4); end; end; writeln; writeln('C array:'); for i:=1 to 3 do begin; writeln; for j:=1 to 3 do begin; c[i,j]:=a[i,j]*b[i,j]; write(c[i,j]:4); end; end; end. 2)var a:array of array of integer; i,j,k,n,u:integer; begin; randomize; readln(n); setlength(a,n+1); for i:=1 to n do setlength(a[i],n+1); writeln('A array:'); for i:=1 to n do begin; writeln; for j:=1 to n do begin; a[i,j]:=random(-10,10); write(a[i,j]:4); end; end; for i:=1 to n do begin; for j:=1 to n do u+=a[i,j]; if u<0 then inc(k); u:=0; end; writeln; write('Result:',k); end.
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Использование базы данных в различных профессиях ( сообщение по информатике
b:array[1..3,1..3] of integer;
c:array[1..3,1..3] of integer;
i,j:integer;
begin;
writeln('A array:');
for i:=1 to 3 do
begin;
writeln;
for j:=1 to 3 do
begin;
a[i,j]:=random(-10,10);
write(a[i,j]:4);
end;
end;
writeln;
writeln('B array:');
for i:=1 to 3 do
begin;
writeln;
for j:=1 to 3 do
begin;
b[i,j]:=random(-10,10);
write(b[i,j]:4);
end;
end;
writeln;
writeln('C array:');
for i:=1 to 3 do
begin;
writeln;
for j:=1 to 3 do
begin;
c[i,j]:=a[i,j]*b[i,j];
write(c[i,j]:4);
end;
end;
end.
2)var a:array of array of integer;
i,j,k,n,u:integer;
begin;
randomize;
readln(n);
setlength(a,n+1);
for i:=1 to n do
setlength(a[i],n+1);
writeln('A array:');
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
a[i,j]:=random(-10,10);
write(a[i,j]:4);
end;
end;
for i:=1 to n do
begin;
for j:=1 to n do
u+=a[i,j];
if u<0 then inc(k);
u:=0;
end;
writeln;
write('Result:',k);
end.