Sub Ìàêðîñ1() Dim Sum(heigth - 1, width - 1) Dim Product(heigth - 1, width - 1)
For i = 0 To heigth - 1 For j = 0 To width - 1 Sum(i, j) = i + j Product(i, j) = i * j Next j Next i
Call Show(Sum, 0, 0) Call Show(Product, 0, 12) End Sub
Sub Show(ByRef m, dx, dy) For i = 0 To heigth - 1 For j = 0 To width - 1 ActiveSheet.Cells(dx + i + 1, dy + j + 1).Value = Hex(m(i, j)) Next j Next i End Sub
i,j,s:integer;
begin
for i:=1 to 4 do
for j:=1 to 4 do
readln(a[i,j]);
for i:=1 to 4 do begin
writeln();
for j:=1 to 4 do begin
write(a[i,j],' ');
if (i+j>5) then s:=s+a[i,j];
end;
end;
writeln();
write(s);
end.
2)var a:array[1..4,1..4] of integer;
i,j,s:integer;
begin
for i:=1 to 4 do
for j:=1 to 4 do
readln(a[i,j]);
for i:=1 to 4 do begin
writeln();
for j:=1 to 4 do begin
write(a[i,j],' ');
if (i>J) then s:=s+a[i,j];
end;
end;
writeln();
write(s);
end.
Const width = 10
Sub Ìàêðîñ1()
Dim Sum(heigth - 1, width - 1)
Dim Product(heigth - 1, width - 1)
For i = 0 To heigth - 1
For j = 0 To width - 1
Sum(i, j) = i + j
Product(i, j) = i * j
Next j
Next i
Call Show(Sum, 0, 0)
Call Show(Product, 0, 12)
End Sub
Sub Show(ByRef m, dx, dy)
For i = 0 To heigth - 1
For j = 0 To width - 1
ActiveSheet.Cells(dx + i + 1, dy + j + 1).Value = Hex(m(i, j))
Next j
Next i
End Sub