C기준으로.
if( !f() ^ a )
------
c를 기준으로
!0 == 1 을 보장하지 않는데요?
대부분의 c compiler 는 !0 을 1로 처리하긴 하지만요.
------
http://anubis.dkuug.dk/JTC1/SC22/WG14/www/docs/n869/n869.txt.gz 에 따르면
[#5] The result of the logical negation operator ! is 0 if
the value of its operand compares unequal to 0, 1 if the
value of its operand compares equal to 0. The result has
type int. The expression !E is equivalent to (0==E).
http://www-ccs.ucsd.edu/c/express.html#Logical%20NOT 또한
!X
You write !X to test whether X is zero. If X is zero, the value of the
expression is 1; otherwise, the value is zero.
라고하므로... 처음께 정답 맞지 싶은데..
심심한김에 하나 더하면..
if( f()*a || !f()*!a)