【发布时间】:2021-07-05 11:24:33
【问题描述】:
您好,我对编码非常陌生,正在尝试弄清楚如何创建二维数组。这要求用户输入行和列大小,而不是用随机数填充那些选择的行和列大小。经过几天的努力,我决定来这里寻求帮助。到目前为止,这是我所拥有的,它遍布我所知道的所有地方。
char row = 'i';
char column = 'j';
int[,] twoDarray = new int[row, column];
int min = 0;
int max = 100;
Random randNum = new Random();
for (int i = 0; i < twoDarray.Length; ++i)
for (int j = 0; j < twoDarray.Length; ++j)
{
twoDarray[i, j] = Convert.ToInt32(In.ReadLine());
}
【问题讨论】:
-
你有什么问题?请收下tour、阅读what's on-topic here、How to Ask和question checklist,
标签: c# for-loop multidimensional-array random user-input