Here there is such a python code:

if not(j == 0 or j == 1 and i == 0) 

What will it look like in C ++ or java?

Correct if wrong:

 if ( !(j==0 || j==1) || (i==0) ) 
  • Hm if (j && (i || j! = 1)) I can’t say the truth about java. - alexlz
  • all such good fellows, and somebody in the course in what order the or and and and operations are performed and generally all the contents in brackets in Python? - Viacheslav


2 answers 2

 if(!(j==0||j==1&&i==0)) if(j!=0&&(j!=1||i!=0))//тоже самое 
      if ( ! ((j == 0 || j == 1) && i == 0) ) 
    • And if you put negative inside, then it’s like this:> if ((j! = 0 || j! = 1) && i! = 0)? - Stas0n
    • And this will be another expression. Learn some logic - skegg
    • It seems to me that internal brackets are not needed - because the log. Operators are calculated from left to right, but I wonder if the compiler options can affect the calculation of this expression - gecube
    • And the alternative is: if (i! = 0 (j! = 0 && j! = 1)) - gecube