一、任务
编写一个控制台应用程序,可根据输入的月份判断所在季节
二、代码
static void Month() { int month; Console.WriteLine("***********季节判定系统**********"); Console.WriteLine("请输入月份:(如“1”)"); month = int.Parse(Console.ReadLine()); if (month == 1 || month == 2 || month == 3) { Console.WriteLine(month + "月份为春季"); } else if (month == 4 || month == 5 || month == 6) { Console.WriteLine(month + "月份为夏季"); } else if (month == 7 || month == 8 || month == 9) { Console.WriteLine(month + "月份为秋季"); } else if (month == 10 || month == 11 || month == 12) { Console.WriteLine(month + "月份为冬季"); } }