Ja, szczerze mówiąc, nie wiem, po co ci to wszystko tak komplikować, ale proszę bardzo:
Console.Write("Please insert values separated by white-space: ");
string userInputLine1 = Console.ReadLine();
Console.Write("Please insert values seperated by white-space again: ");
string userInputLine2 = Console.ReadLine();
string[] userInputLine1Splitted = userInputLine1.Split(" ");
string[] userInputLine2Splitted = userInputLine2.Split(" ");
// Either this or catch an out-of-boundary exception when one is larger than the other and fill the space with 0's or something else.
if (userInputLine1Splitted.Length != userInputLine2Splitted.Length)
{
throw new Exception("Both 1d arrays need to be the same length!");
}
int lengthOfArray = userInputLine1Splitted.Length;
// Since we always have only 2 rows this can be hardcoded.
int[,] TwoDArrayFromUserInput = new int[2, lengthOfArray];
for (int col = 0; col < lengthOfArray; col++)
{
TwoDArrayFromUserInput[0, col] = Convert.ToInt32(userInputLine1Splitted[col]);
TwoDArrayFromUserInput[1, col] = Convert.ToInt32(userInputLine2Splitted[col]);
}
// Print to console to prove it worked.
for (int row = 0; row < 2; row++)
{
for (int col = 0; col < lengthOfArray; col++)
{
Console.Write(TwoDArrayFromUserInput[row, col] + " ");
}
Console.WriteLine();
}
Gdybyście mogli podać swój przypadek użycia, jestem prawie pewien, że byłbym w stanie pomóc ci znaleźć najlepsze rozwiązanie.