"비트연산 XOR"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
5번째 줄: 5번째 줄:
==C==
==C==
[[분류: C]]
[[분류: C]]
<source lang='c'>
<syntaxhighlight lang='c'>
#include<stdio.h>
#include<stdio.h>
int main() {
int main() {
   printf("%d",5^6); // 3
   printf("%d",5^6); // 3
}
}
</source>
</syntaxhighlight>


==Java==
==Java==
[[분류:Java]]
[[분류:Java]]
{{참고|자바 ^}}
{{참고|자바 ^}}
<source lang='java'>
<syntaxhighlight lang='java'>
System.out.println( true ^ true ); // false
System.out.println( true ^ true ); // false
System.out.println( true ^ false ); // true
System.out.println( true ^ false ); // true
22번째 줄: 22번째 줄:


System.out.println( 5 ^ 6 ); // 3
System.out.println( 5 ^ 6 ); // 3
</source>
</syntaxhighlight>


==PHP==
==PHP==
[[분류:PHP]]
[[분류:PHP]]
<source lang='Python'>
<syntaxhighlight lang='Python'>
echo 5 ^ 6;
echo 5 ^ 6;
# 3
# 3
</source>
</syntaxhighlight>


==Python==
==Python==
[[분류:Python]]
[[분류:Python]]
<source lang='Python'>
<syntaxhighlight lang='Python'>
print( 5 ^ 6 )
print( 5 ^ 6 )
# 3
# 3
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:31 기준 최신판

bitwise XOR
비트연산 XOR

1 C[ | ]

#include<stdio.h>
int main() {
   printf("%d",5^6); // 3
}

2 Java[ | ]

System.out.println( true ^ true ); // false
System.out.println( true ^ false ); // true
System.out.println( false ^ true ); // true
System.out.println( false ^ false ); // false

System.out.println( 5 ^ 6 ); // 3

3 PHP[ | ]

echo 5 ^ 6;
# 3

4 Python[ | ]

print( 5 ^ 6 )
# 3

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}