老狼老狼几点了

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 老狼老狼_几点了
{
    class Program
    {
        static void Main(string[] args)
        {
            while(true)
            {
            Console.Write("老狼老狼,几点了");
            string s = Console.ReadLine();
            int hour =Convert.ToInt32(s);
            if (hour>0&&hour<6)
            {
               
                Console.WriteLine("凌晨"+s+"");

            }
            if (hour > 6 && hour < 12)
            {
                Console.WriteLine("早上" + hour + "");
            }
            if (hour > 12 && hour < 18)
            {
                hour = hour - 12;
                Console.WriteLine("下午" + hour + "");
            }
            if (hour > 18 && hour < 24)
            {
                hour = hour - 12;
                Console.WriteLine("晚上" + hour + "");
            }
            else
            {
                Console.WriteLine("无法识别的时间");
            }
            Console.ReadLine(); 

               
                
            }
        }
    }
}

 

posted @ 2015-06-18 13:57  蓝瑟黄昏  阅读(151)  评论(0编辑  收藏  举报