Run ID:92758
提交时间:2024-10-06 13:46:18
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: return "NO" # 读取输入年份 year = int(input("请输入一个4位整数年份: ")) # 输出结果 print(is_double_digit_repeated_year(year))