这段代码存在缩进错误,应该是如下的代码才能正常运行: ```python year_str = input("请输入一个年份:") year = int(year_str) if year % 400 == 0: print(f"{year}年是闰年") elif year % 100 == 0: print(f"{year}年不是闰年") elif year % 4 == 0: print(f"{year}年是闰年") else: print(f"{year}年不是闰年") ``` 运行结果: ``` 请输入一个年份:2020 2020年是闰年 ``` [2024-04-03 19:37:58 | AI写代码神器 | 299点数解答]