我正在 VB 中制作一个二维数组,我需要帮助试图弄清楚如何在二维数组中选择一个位置,然后输入一个值。我知道如何遍历数组元素并向其添加值,但如果我只是选择一个位置并输入一个值,这将是一种更快的方法。
谢谢
Console.WriteLine("想在什么位置输入值:") userInput = Console.ReadLine
Console.WriteLine(" Would you like to enter another 1 ?? (Y or N)")
If (reply = "Y") Or (reply = "y") Then
reply = Console.ReadLine()
Console.WriteLine("What position would like to enter a value:")
userInput = Console.ReadLine
End If
For row = 0 To cRow
For column = 0 To cColumn
If grid(row, column) = 0 Then
Console.Write(Chr(32))
Else
Console.Write(Chr(42))
End If
Next
Console.WriteLine()
Next