草庐IT

isValueBig

全部标签

c# - 三元运算符如何工作?

请演示三元运算符如何与常规if/elseblock一起使用。示例:BooleanisValueBig=value>100?true:false;完全重复:HowdoIusetheternaryoperator? 最佳答案 BooleanisValueBig=(value>100)?true:false;BooleanisValueBig;if(value>100){isValueBig=true;}else{isValueBig=false;} 关于c#-三元运算符如何工作?,我们在St