Ich versuche Zufallszahl in einem gezackten Array zu füllen, aber ich bin Fehler in dieser Zeile bekommen:Zufallszahlen in Array Füllung: ERROR: implizit nicht int type [] int
arr[size] = randNum.Next(Min, Max);
ERROR : kann []
Hier vollständigen Code nicht implizit int int-Typ ist:
Random randNum = new Random();
int Min = 1;
int Max = 100;
int rows;
int size;
Console.WriteLine("Enter the number of rows of jagged array:");
rows = int.Parse(Console.ReadLine());
// Declare the array of two elements:
int[][] arr = new int[rows][];
for (int i = 0; i <= rows; i++)
{
Console.WriteLine("Enter the size of" +rows +" :");
size = int.Parse(Console.ReadLine());
for (int j = 0; j <= size; j++)
{
arr[j] = new int[size];
int n = 0;
while (n < size)
{
arr[size] = randNum.Next(Min, Max);
}
}
}
kann irgend jemand Hilfe in dieser Hinsicht?
_arr [i] [n] = randNum.Next (Min, Max); n ++ _ – Steve