search

Home  >  Q&A  >  body text

How should I write the assignment that is not divisible by 100 and 400?

How to write the assignment that cannot be divisible by 100 and 400

................2223 days ago1356

reply all(2)I'll reply

  • 小明

    小明2018-12-05 19:36:34

    $a=2000;
    if (($a%400==0)&&($a%100==0)) {
    	echo "整除!";
    }else{
    	echo "不整除了!";
    }


    reply
    0
  • 天蓬老师

    It seems that you are doing an exercise to find a leap year. You cannot form a team, so you need to add % before it!

    天蓬老师 · 2018-12-07 14:00:34
  • Cancelreply