日期:2014-05-18 浏览次数:21056 次
static void Main(string[] args)
{
int enter;
int month;
Console.WriteLine("请输入您属于哪种参观者:");
Console.WriteLine("1-1.2米以下儿童");
Console.WriteLine("2-大中小学生");
Console.WriteLine("3-离休人员");
Console.WriteLine("4-老年人");
Console.WriteLine("5-其他");
enter = int.Parse(Console.ReadLine());
Console.WriteLine("请输入参观月份");
month = int.Parse(Console.ReadLine());
if (enter == 1 && enter == 3)
{
if (month >= 1 && month <= 12)
{
Console.WriteLine("免票");
}
else
{
Console.WriteLine("月份输入错误");
}
}
else if (enter == 2)
{
if (month >= 1 && month <= 12)
{
Console.WriteLine("门票20元");
}
else
{
Console.WriteLine("月份输入错误");
}
}
else if (enter == 4)
{
if ((month <= 3 && month >= 1) || (month <= 12 && month >= 11))
{
Console.WriteLine("门票20元");
}
else if (month > 3 && month < 11)
{
Console.WriteLine("门票30元");
}
else
{
Console.WriteLine("月份输入错误");
}
}
else if (enter == 5)
{
if ((month <= 3 && month >= 1) || (month <= 12 && month >= 11))
{
Console.WriteLine("门票60元");
}
else if (month > 3 && month < 11)
{
Console.WriteLine("门票40元");
}
else
{
Console.WriteLine("月份输入错误");
}
}
Console.ReadLine();
if (enter == 1 && enter == 3)
{
if (month >= 1 && month <= 12)
{
Console.WriteLine("免票");
}
else
{
Console.WriteLine("月份输入错误");
}
}
else if (enter == 2)
{
if (month >= 1 && month <= 12)
{
Console.WriteLine("门票20元");
}
else
{
Console.WriteLine("月份输入错误");
}
}