题目
https://www.lanqiao.cn/problems/2296/learning/?page=1&first_category_id=1&sort=pass_rate&second_category_id=3&tags=2022
问题描述
请找到一个大于 20222022 的最小数,这个数转换成二进制之后,最低的 66 个二进制位全为 00 。
请将这个数的十进制形式作为答案提交。
答案提交
本题为一道结果填空的题,只需要算出结果后,在代码中使用输出语句将结果输出即可。
运行限制
- 最大运行时间:1s
- 最大运行内存: 256M
总通过次数: 574 | 总提交次数: 585 | 通过率: 98.1%
难度: 简单 标签: 2022, 省模拟题
答案
num = 2023
s = ""
while True:
s1 = num % 2
s2 = num // 2 % 2
s3 = num // 4 % 2
s4 = num // 8 % 2
s5 = num // 16 % 2
s6 = num // 32 % 2
if s1 == 0 and s2 == 0 and s3 == 0 and s4 == 0 and s5 == 0 and s6 == 0:
print(num)
break
num += 1