<script>
var apples=12;
var kids=3;
var msg=(apples> and apples % kids==0)?"可以均分":"不能均分";
document.write(msg);
</script>
12345678 <script> var apples=12; var kids=3; if((apples >= kids) && (apples % kids == 0)) {document.write("可以均分")} else {document.write("不能均分")}</script>
<script> var apples=12; var kids=3; if((apples >= kids) && (apples % kids == 0)) {document.write("可以均分")} else {document.write("不能均分")} </script>
第四行的and换成&&