• 2021-04-14
    条件“y能被4整除但不能被100整除 或 y能被400整除”的C语言逻辑表达式是(y%4==0) && (y%100!=0)|| (y%400==0)( )。
  • 内容

    • 0

      正确排序使程序能够判断某一年是否为闰年 。判断闰年的条件是:年份能被4整除且不能被 100[br][/br] 整除 ,或者能被 400 整除。 A: print("不是闰年") B: print("是闰年") C: y = int( input('请输入年份>>')) D: if y % 4 == 0 and y % 100 != 0 or y % 400 == 0 : E: else:

    • 1

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

    • 2

      判断某一年y是否是闰年。闰年的条件是符合下面二者之一:①能被4整除,但不能被100整除; ②能被400整除,下列语句正确的是 A: if y mod 4 =0 and y mod 100 <> 0 and y mod 400=0 then msgbox y & "是闰年"else msgbox y & "不是闰年"end if B: if (y mod 4 =0 and y mod 100 <> 0) or y mod 400=0 then msgbox y &"不是闰年"else msgbox y & "是闰年"end if C: if (y mod 4 =0 or y mod 100 <> 0) and y mod 400=0 then msgbox y &"是闰年"else msgbox y & "不是闰年"end if D: if (y mod 4 =0 and y mod 100 <> 0) or y mod 400=0 then msgbox y &"是闰年"else msgbox y & "不是闰年"end if

    • 3

      能表示整数x符合下面两个条件的语句是( )。(1)能被4整除,但不能被100整除。(2)能被4整除,又能被400整除。 A: (x%4==0&&x%100!=0)||x%400==0 B: (x%4==0&&x%400!=0)||x%100==0 C: (x%4==0||x%100!=0)&&x%400==0 D: (x%100==0||x%4!=0)&&x%400==0

    • 4

      闰年的判定条件是能被400整除,或者能被4整除但不能被100整除,正确的Python表达式为( )。 A: (year%400==0) or (year%4==0 and year % 100!=0) B: year%400==0 and year%4==0 and year % 100!=0 C: (year//400==0) or (year//4==0 and year//100!=0) D: year//400==0 or year//4==0 and year//100!=0