C#数组相乘
来源:互联网 发布:淘宝的全球购是真的吗 编辑:程序博客网 时间:2024/05/19 14:34
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace matrixMutiply{ class Program { static void Main(string[] args) { int[,] arrayA = new int[,] { { 8, 3, 4 }, { 1, 5, 9 }, { 6, 7, 2 } }; int[,] arrayB = new int[,] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; int[,] arrayC = new int[3, 3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { arrayC[i, j] += arrayA[i,k] * arrayB[k,j]; } } } Console.WriteLine("矩阵A:"); displayMatrix(arrayA); Console.WriteLine("矩阵B"); displayMatrix(arrayB); Console.WriteLine("矩阵C"); displayMatrix(arrayC); Console.ReadLine(); } public static void displayMatrix(int[,]matrix) { for(int i=0;i<matrix.GetLength(0);i++) { for (int j = 0; j < matrix.GetLength(1); j++) { Console.Write("{0,4}", matrix[i, j]); } Console.WriteLine(); } } }}
0 0
- C#数组相乘
- 数组相乘
- 数组::矩阵相乘
- 数组实现大数相乘
- 大数相乘,数组
- 二维数组 矩阵相乘
- C#版大数相乘
- C# 大数相乘
- c#大数相乘
- C# 大数相乘法
- 大整数相乘(数组实现)
- 伪数组代码&&矩阵相乘
- 2维数组矩阵相乘
- 不等规模二维数组相乘
- 用递归实现数组元素相乘
- 数组与矩阵(1)_矩阵相乘
- Java之数组计算大数相乘
- 矩阵相乘的一维数组实现
- Map/Reduce API 样例一
- SSH登录日志分析脚本(Python)
- linux 命令系列之网络命令(12)
- eclipse常用插件的安装使用
- Problem 34—Digit factorials
- C#数组相乘
- Navicat Lite for MySQL说明及Mysql基础知识
- 改造AnimationUtils,改为RotateAnimation
- linux 命令系列之关机命令(13)
- Java实现发送邮件功能
- 从Windows到Ubuntu迁徙计划
- 4.22模拟总结
- C#值类型与引用类型,装箱与拆箱操作
- linux 命令系列之vim(14)