int i;
int[] mArray = new int[5];
for (i = 0; i < mArray.Length; i++)
{
Console.WriteLine("Please enter a number:");
mArray[i] = Convert.ToInt32(Console.ReadLine());
if (mArray[i] >= 50 && mArray[i] <= 10)
{
Console.WriteLine("Please enter numbers only between 10 and 50.");
mArray[i] = Convert.ToInt32(Console.ReadLine());
}
}
当 if 语句中有两条规则时,它似乎无法正常工作 if (mArray[i] >= 50 && mArray[i] <= 10)
但它适用于 1 条规则if (mArray[i] >= 50)