Python 输入一个年份,判断是否为闰年

闰年: 4的倍数,可是不能被100整除,且能被400整除input   year = int (input ( "请输入年份:" )) if (year % 4 ==0 and year % 100 !=0) or year % 400 ==0: print("yes!") else:print("no!")
相关文章
相关标签/搜索