|
zadach44.BAS |
|
{* Задача44 *}REM basic ' Рассчитать Y = k(M1+M2/2), где k - константа; M1, M2 - матрицы размером (3, 4).CLS
Dim M1(1 To 3, 1 To 4), M2(1 To 3, 1 To 4)
For i = 1 To 3 For j = 1 To 4 M1(i, j) = CInt(RND * 8 + 1) PRINT M1(i, j);
Next j: PRINT : Next i: PRINT
For i = 1 To 3 For j = 1 To 4 M2(i, j) = CInt(RND * 8 + 1) PRINT M2(i, j);
Next j: PRINT : Next i: PRINT
INPUT "k = ", k
For i = 1 To 3
For j = 1 To 4 M(i, j) = k * (M1(i, j) + M2(i, j) / 2)
Next j
Next i
PRINT "Результат "
For i = 1 To 3 For j = 1 To 4 PRINT M(i, j);
Next j: PRINT : Next i: PRINT
End
|