Var a:array of array of integer; c:array of array of integer; ma:array of array of integer; i,j,n:integer; begin; randomize; readln(n); setlength(a,n+1); //задаём размерность динамических массивов setlength(c,n+1); setlength(ma,n+1); for i:=1 to n do begin; setlength(a[i],n+1); setlength(c[i],n+1); setlength(ma[i],n+1); end;
writeln('Matrix A:'); //генерируем массив псеводслучайных чисел for i:=1 to n do begin; writeln; for j:=1 to n do begin; a[i,j]:=random(10); write(a[i,j]:4); end; end; writeln;
writeln('Matrix C:'); //аналогично for i:=1 to n do begin; writeln; for j:=1 to n do begin; c[i,j]:=random(10); write(c[i,j]:4); end; end;
for i:=1 to n do //сохраняем матрицу C для транспонации for j:=1 to n do ma[i,j]:=c[i,j]; writeln;
writeln('Transpose matrix C:'); //транспонируем C for i:=1 to n do begin; writeln; for j:=1 to n do begin; c[i,j]:=ma[j,i]; write(c[i,j]:4); end; end;
writeln; writeln('Final matrix:'); // получаем финальную матрицу for i:=1 to n do begin; writeln; for j:=1 to n do begin; ma[i,j]:=2*c[i,j]*a[i,j]; {по свойству дистрибутивности матриц С(A+A)=C*A+C*A=2*C*A} write(ma[i,j]:4); end; end; end.
Объяснение:
No or not?
Grammar > Easily confused words > No or not?
из English Grammar Today
No and not are the two most common words we use to indicate negation. We use no before a noun phrase:
There’s no address on the envelope.
[parent to child]
No biscuits before dinner!
No decisions have been made.
We use not with any other phrase or clause:
It’s not often that you stop and think about the way you breathe.
Not suitable for children under 15.
Not surprisingly, it was a tense match but eventually the more experienced Australians won.
A:
Do you go cycling all year round?
B:
Not in the winter.
c:array of array of integer;
ma:array of array of integer;
i,j,n:integer;
begin;
randomize;
readln(n);
setlength(a,n+1); //задаём размерность динамических массивов
setlength(c,n+1);
setlength(ma,n+1);
for i:=1 to n do
begin;
setlength(a[i],n+1);
setlength(c[i],n+1);
setlength(ma[i],n+1);
end;
writeln('Matrix A:'); //генерируем массив псеводслучайных чисел
for i:=1 to n do begin;
writeln;
for j:=1 to n do
begin;
a[i,j]:=random(10);
write(a[i,j]:4);
end;
end;
writeln;
writeln('Matrix C:'); //аналогично
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
c[i,j]:=random(10);
write(c[i,j]:4);
end;
end;
for i:=1 to n do //сохраняем матрицу C для транспонации
for j:=1 to n do
ma[i,j]:=c[i,j];
writeln;
writeln('Transpose matrix C:'); //транспонируем C
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
c[i,j]:=ma[j,i];
write(c[i,j]:4);
end;
end;
writeln;
writeln('Final matrix:'); // получаем финальную матрицу
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
ma[i,j]:=2*c[i,j]*a[i,j];
{по свойству дистрибутивности матриц С(A+A)=C*A+C*A=2*C*A}
write(ma[i,j]:4);
end;
end;
end.