//PascalABC.NET 3.1 сборка 1219 procedure PrintMatrix(a: array[,] of integer); begin for var i := a.GetLowerBound(0) to a.GetUpperBound(0) do begin writeln; for var j := a.GetLowerBound(1) to a.GetUpperBound(1) do write(a[i, j], ' '); end; writeln; end;
begin var a := MatrixRandom(9, 9, 10, 99); PrintMatrix(a); var i := (a.GetLowerBound(0) + a.GetUpperBound(0)) div 2 + (a.GetLowerBound(0) + a.GetUpperBound(0)) mod 2; var j := (a.GetLowerBound(1) + a.GetUpperBound(1)) div 2 + (a.GetLowerBound(1) + a.GetUpperBound(1)) mod 2; writeln('A[', i, ', ', j, '] = ', a[i, j]); end.
<script type="text/javascript">
// создание многомерного массива.
var arr = new Array(5);
arr[0]= new Array(-1, 2, -3, 4, 5);
arr[1]= new Array(6, 7, -8, 9, 1);
arr[2]= new Array(4, -5, 6, 7, 8);
arr[3]= new Array(-3, 2, -1, 9, 8);
arr[4]= new Array(7, -6, -5, 4, -3);
for (var i = 0; i < arr.length; i++) {
for (var j = 0; j < arr[i].length; j++) {
if (i==j){
if (arr[i][j] < 0)
arr[i][j]= "0"
else
arr[i][j] = "1" ;
//вывод заполненной Ячейки сразу
}
document.write(" " +arr[i][j]+ "");
}
document.write("<br/>");
}
</script>
procedure PrintMatrix(a: array[,] of integer);
begin
for var i := a.GetLowerBound(0) to a.GetUpperBound(0) do
begin
writeln;
for var j := a.GetLowerBound(1) to a.GetUpperBound(1) do
write(a[i, j], ' ');
end;
writeln;
end;
begin
var a := MatrixRandom(9, 9, 10, 99);
PrintMatrix(a);
var i := (a.GetLowerBound(0) + a.GetUpperBound(0)) div 2 + (a.GetLowerBound(0) + a.GetUpperBound(0)) mod 2;
var j := (a.GetLowerBound(1) + a.GetUpperBound(1)) div 2 + (a.GetLowerBound(1) + a.GetUpperBound(1)) mod 2;
writeln('A[', i, ', ', j, '] = ', a[i, j]);
end.