Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
85279 | 彭士宝 | 不吉利的数 | Python3 | Accepted | 330 MS | 3776 KB | 515 | 2024-07-16 21:07:45 |
def is_unlucky(number): # 将号码转换为字符串以便于检查 number_str = str(number) # 检查是否包含'4'或'62' if '4' in number_str or '62' in number_str: return True return False def count_lucky_plates(n, m): count = 0 for i in range(n, m + 1): if not is_unlucky(i): count += 1 return count # 读取输入 n, m = map(int, input().split()) # 输出不包含不吉利数字的统计个数 print(count_lucky_plates(n, m))