【c++】C++ Conditional ? : Operator
c代码写很多小伙伴都能写但是如何efficient并且effective这个应该是还蛮困难的LZ只能说可以写C但是代码不够优雅还需要继续修炼O(∩_∩)O哈哈~介绍一个比较好的表达可以代替if-elseExp1 ? Exp2 : Exp3;如果Exp1为真则Exp2,否则为Exp3.例子如下#include iostream using namespace std; int main(){ int x, y 10; x (y10)?30:40; cout value of x : x endl; return 0; }value of x : 40(o)/~