【格式】
判斷條件?表達式1:表達式2
如果判斷條件成立,則執(zhí)行表達式1,否則執(zhí)行表達式2,三目運算符可以簡化成if else的寫法
在比較三個數(shù)的大小時,不能直接cout<<a>b&&a>c?a:(b>c?b:c)
會報錯:[Error] no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')?