blo*_*att 3 c# arrays console-application visual-studio-2010
我正在使用Microsoft Visual Studio 2010和C#。这个函数在我的控制台程序中的其他地方都被称为form,但是我似乎无法输入到array中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;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13587 次 |
| 最近记录: |