标签:pre namespace key string ogr ram pretty pac http
namespace _04.练习01
{
class Program
{
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:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
Console.WriteLine("该月有31天!");
break;
case 4:
case 6:
case 9:
case 11:
Console.WriteLine("该月有30天!");
break;
case 2:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
{
Console.WriteLine("该月有29天.");
}
else
{
Console.WriteLine("该月有28天.");
}
break;
}
Console.ReadKey();
}
}
}
标签:pre namespace key string ogr ram pretty pac http
原文地址:http://www.cnblogs.com/HelloZyjS/p/6017109.html