• 2022-07-26
    '''判断某一年是否为闰年 。判断闰年的条件是:年份能被4整除且不能被 100 整除 ,或者能被 400 整除。 ''' [br][/br] y = int( input('请输入年份>>')) if print("是闰年") y % 4 == 0 and y % 100 != 0: print("是闰年") else: ("不是闰年")
  • 举一反三