int monthentered = 0;
int dayentered = 0;
int year = 0000;
int [] month = new int [12];
int [] day = new int [31];
bool leap = false;
for (int x = 0; x <= 11; x++)
{
month[x] = x+1;
}
for (int x = 0; x <= 30; x++)
{
day[x] = x+1;
}
Console.WriteLine("Please enter a year...");
year = (Convert.ToInt16(Console.ReadLine()));
Console.WriteLine("{0}", year);
Console.WriteLine("Please enter a month...");
monthentered = (Convert.ToInt16(Console.ReadLine()));
Console.WriteLine("Please enter a day...");
dayentered = (Convert.ToInt16(Console.ReadLine()));
while (monthentered == 01 || 03 || 05 || 07 || 08 || 10 || 12)
{
while (dayentered == 31)
{
Console.WriteLine("There are only 30 days in this month please re-enter your day...");
dayentered = (Convert.ToInt16(Console.ReadLine()));
}
}
while (monthentered == 02)
{
while (dayentered > 28)
{
Console.WriteLine("There are only 28 days in this month please re-enter your day...");
dayentered = (Convert.ToInt16(Console.ReadLine()));
}
}
Console.WriteLine("{0}/{1}/{2}", dayentered, monthentered, year);
Console.ReadKey();
线路有什么问题while (monthentered == 01 || 03 || 05 || 07 || 08 || 10 || 12)
吗?我收到一个我不明白的错误。"Operator '||' cannot be applied to operands of type 'bool' and 'int'"
请帮忙。