判断一个月份为上半年或下半年

String b=Console.ReadLine();

int a=int.Parse(b);

string s=(a>=1&&a<=6)?("上半年"):((a>=7&&a<=12)?("下半年"):("请输入正确的日期"));

Console.WriteLine(s);

Console.ReadLine();

posted @ 2014-12-13 21:02  ヾBailey灬  阅读(362)  评论(0编辑  收藏  举报