编辑代码

using System;
namespace HelloWorldApplication
{
   class HelloWorld
   {
      static void Main(string[] args)
      {
        
         Console.WriteLine("请输入年份");
		int year = Convert.ToInt32(Console.ReadLine());
		 Console.WriteLine("请输入月份");
		int month = Convert.ToInt32(Console.ReadLine());
        switch(month){
			case 1: Console.WriteLine("该月有30天");
                    break;
			case 2: if((year/4 == 0 && year/100 != 0) || (year/400 == 0))
						{
			Console.WriteLine("该月有29天");
			}else
			{
				Console.WriteLine("该月有28天");
			}
                         break;
            default:  Console.WriteLine("该月有30天");
                    break;
		  Console.ReadKey();
		}
        
      }
   }