Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想定义一些:
int m=5; int [,] matrix=new int[4,m];
可能吗?
您所拥有的适用于固定尺寸。如果你想要一个动态矩阵,那么使用类似的东西
var matrix = new List<List<int>>();
我构造的数组名称是矩阵,维度为 3*3。您可以根据需要更改此代码。
int m=3 int [,] matrix = int [3,m] = { {0, 1, 2, 3} , {4, 5, 6, 7} , {8, 9, 10 } };