Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure ReadMatrix(var Matrixx: MatrixType; FName: string);
- var
- MyFileInPut: TextFile;
- i, j, n: Integer;
- Arr: array of array of Integer;
- begin
- AssignFile(MyFileInPut, FName);
- Reset(MyFileInPut);
- for i := 0 to n - 1 do
- for j:=0 to n - 1 do
- Read(myFileInput, Matrixx[i, j]);
- CloseFile(MyFileInPut);
- end;
- function Average(MatrixType = array of array of Integer; n: integer): Real;
- var
- Sum, Amount, i, j: Integer;
- begin
- Sum := 0;
- Amount := 0;
- for i := 0 to n - 1 do
- for j := 0 to n - 1 do
- if MatrixType[j, i] > 0 then
- begin
- Sum := Sum + MatrixType[j, i];
- Inc(Amount);
- end;
- Average := Sum/Amount;
- end;
Advertisement
Add Comment
Please, Sign In to add comment