现在的位置: 首页 > 综合 > 正文

c# 中三元运算符的使用

2013年08月18日 ⁄ 综合 ⁄ 共 174字 ⁄ 字号 评论关闭
 

  1.             int i = 1;
  2.             string s = i.ToString() + " ";
  3.             s += (i == 1 ? " boy " : " girl ");
  4.             Console.WriteLine( s );
  5.             Console.Read();

抱歉!评论已关闭.