题目:输入一个24小时制的整数时间,判断所在时间段。
int a,b; a = int.Parse(Console .ReadLine());//输入的时间 b = 12; string s; s = a-b > 0 ?a-b+"pm" :a+"am" ; Console.WriteLine(s);
关于条件运算符的应用
原文:http://www.cnblogs.com/shaobing012/p/4543183.html