亚索的题解 | #二进制位运算#
二进制位运算
https://www.nowcoder.com/practice/fa89690611f84cdcaba9a843e884310b
# 输入两个整数 x,y=input().split() # 进行位与运算 bit_and = x & y # 进行位或运算 bit_or = x | y # 输出结果 print(bit_and) print(bit_or)
收获:
(1)用x,y直接接输入
(2)与运算& 或运算| 非运算~ (波浪号)
二进制位运算
https://www.nowcoder.com/practice/fa89690611f84cdcaba9a843e884310b
# 输入两个整数 x,y=input().split() # 进行位与运算 bit_and = x & y # 进行位或运算 bit_or = x | y # 输出结果 print(bit_and) print(bit_or)
收获:
(1)用x,y直接接输入
(2)与运算& 或运算| 非运算~ (波浪号)
相关推荐