打赌 条件运算符 (表达式?值1:值2) 赌注内容 奖励 奖励 y=(x==2?100:50); x==2,那么y=100 x!=2,那么y=50 #include int main() { int x=20; char y; y=(x>0?'A':'B'); printf("%c",y); return 0; }
转载于:https://www.cnblogs.com/amiaojiang/p/4503718.html
转载于:https://www.cnblogs.com/amiaojiang/p/4503718.html