알고리즘/코드업
[CodeUp]기초100제(python)_1062번 : [비트단위논리연산] 비트단위로 XOR 하여 출력하기
Orange57
2020. 3. 29. 17:36
728x90
반응형
SMALL
문제 :
입력된 정수 두 개를 비트단위로 xor 연산한 후 그 결과를 정수로 출력해보자.
비트단위(bitwise) 연산자 ^(xor, circumflex/caret, 서컴플렉스/카릿)를 사용하면 된다.
답 :
설명 :
비트 연산자(Bitwise) 정리 부분 참고
=> https://deepflowest.tistory.com/49
[파이썬] 비트 연산자(Bitwise)
▶ 비트 논리 연산자 AND & 둘 다 1이면 1 OR | 둘 다 0이면 0 XOR ^ 같으면 0, 다르면 1 not ~ 1은 0으로, 0은 1로 ● AND ● OR ● XOR ● not ▶ 시프트 연산자 전체 비트를 하나씩 왼쪽 or 오른쪽으로 옮..
deepflowest.tistory.com
코드 : https://github.com/Yearang-Lee/Algorithm/tree/master/CodeUp
Yearang-Lee/Algorithm
Contribute to Yearang-Lee/Algorithm development by creating an account on GitHub.
github.com
728x90
반응형
LIST