0

Вопрос по ternary, c, operator-precedence – Приоритет оператора и троичный оператор

Error: User Rate Limit Exceeded #include int main() { int a = 10, b = 0, c = 7; if (a ? b : c == 0) printf("1"); else if (c = c || a && b) printf("2"); return 0; }Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded<a href="http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence" rel="nofollow noreferrer">precedence order</a>Error: User Rate Limit Exceeded

от Oliver Charlesworth

Error: User Rate Limit Exceeded

от Blagovest Buyukliev

2 ответа

4

Error: User Rate Limit Exceeded?:Error: User Rate Limit Exceeded==Error: User Rate Limit Exceeded

if(a ? b : (c == 0)) { ... }

Error: User Rate Limit Exceeded

if((a ? b : c) == 0) { ... }
3

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

  if (a ? b : c == 0)

Error: User Rate Limit Exceeded

if(10 ? 0 : 7 == 0)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

else if (7 = 7 || 10 && 0)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

 if( (a ? b:c) == 0){...}

Error: User Rate Limit Exceeded

Похожие вопросы