Var a:array[1..100,1..100] of integer; c:array[1..20,1..20] of real; b:array[1..20,1..20] of real; i,j,n,k:integer; t:real; r:integer; begin randomize; t:=0; Writeln('Введите порядок матрицы: '); readln(n); for i:=1 to n do for j:=1 to n do begin a[i, j] := random(10); end; for i:=1 to n do for j:=1 to n do begin b[i,j]:=1/i+j-1; end; for i:=1 to n do for j:=1 to n do begin for k:=1 to n do begin t :=t+a[i,k]*b[k, j]; end; c[i,j]:=t; t:=0; end; for i:=1 to n do begin for j:=1 to n do begin write(' ',c[i,j]:2:2); end; Writeln; end;
using namespace std;
int main() {
int mat[3][3];
int k;
int size=0;
int * arr=0;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>mat[i][j];
if (mat[i][j]>0){
arr=(int*)realloc(arr,sizeof(int)*(++size));
arr[size-1]=mat[i][j];
}
}
}
for(int i=0;i<size;i++){
cout<<arr[i];
}
delete arr;
cin.get();
cin.get();
return 0;
}