Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92755 | 繁昌校区 | 2020 | Python3 | Wrong Answer | 36 MS | 3732 KB | 739 | 2024-10-06 13:44:50 |
def is_double_digit_repeated_year(year): # 将年份转换为字符串 year_str = str(year) # 获取前两个和后两个字符 first_half = year_str[:2] second_half = year_str[2:] # 检查两半是否相等 if first_half == second_half: return "YES" else: # 检查反向两半是否相等(例如 1122 -> 12 和 21) reversed_first_half = first_half[::-1] if reversed_first_half == second_half: return "YES" else: return "NO" # 读取输入年份 year = int(input("请输入一个4位整数年份: ")) # 输出结果 print(is_double_digit_repeated_year(year))
------Input------
2121
------Answer-----
YES
------Your output-----