【发布时间】:2026-02-15 16:45:01
【问题描述】:
我正在使用 Microsoft Visual Studio 2010 和 C#。这是一个在我的控制台程序的其他地方被调用的函数,但我似乎无法将输入输入到数组ipoints。
static void GetPoints(int ipoints, string srestaurant)
{
int index = 0;
int iinput;
for (index = 0; index < 5; index++)
{
Console.Write("please enter how many points " + srestaurant[index] + " got : ");
iinput = Convert.ToInt32(Console.ReadLine());
while (iinput < 0 && iinput > 20)
{
Console.Write("please enter how many points " + srestaurant[index] + " got : ");
iinput = Convert.ToInt32(Console.ReadLine());
}
ipoints[index] = iinput;
}
}
【问题讨论】:
标签: c# arrays visual-studio-2010 console-application