using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 练习1
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入年份:");
int year = int.Parse(Console.ReadLine());
Console.Write("请输入月份");
int month = int.Parse(Console.ReadLine());
switch (month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
Console.WriteLine("31天");
break;
case 2:
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
{
//是润年
Console.WriteLine("29天");
}
else
{ //不是润年
Console.WriteLine("28天");
}
break;
default:
break;
}
Console.ReadKey();
}
}
}
335




被折叠的 条评论
为什么被折叠?



