Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program {
- static double[,] matr3_mul(double[,] mas1, double[,] mas2)
- {
- double[,] res = new double[3, 3];
- for (int i=0; i<3; i++) //строки
- {
- for (int j=0; j<3; j++) //столбцы
- {
- res[i, j] = mas1[i, 0] * mas2[0, j] + mas1[i, 1] * mas2[1, j] + mas1[i, 2] * mas2[2, j];
- }
- }
- return res;
- }
- static void Main(string[] args) {
- double[,] mas1={
- {5, 8, -4},
- {6, 9, -5},
- {4, 7, -3}
- };
- double[,] mas2={
- {3, 2, 5},
- {4, -1, 3},
- {9, 6, 5}
- };
- double[,] res=matr3_mul(mas1, mas2);
- for (int i=0; i<3; i++){
- for (int j=0; j<3; j++){
- Console.Write(res[i, j]+" ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement