老狼老狼几点了

while (true)
{
Console.WriteLine("请输入现在几点;");
int a;
a = Convert.ToInt32(Console.ReadLine());
if (a > 0 && a < 6)

Console.WriteLine("现在是凌晨" + a + "点");

else if (a > 6 && a <= 12)

Console.WriteLine("现在是上午" + a + "点");

else if (a > 12 && a < 18)

Console.WriteLine("现在是下午" + (a - 12) + "点");

else if (a > 18 && a <= 24)

Console.WriteLine("现在是晚上" + (a - 12) + "点");

else
Console.WriteLine("输错了,傻X");

Console.ReadLine();
}

posted @ 2015-03-28 09:03  耿鹏飞  阅读(186)  评论(0编辑  收藏  举报