$a=78;
if($a <=100 and $a >=90){
echo "甲";
}
if($a <=89 and $a >=70 ){
echo "乙";
}
if($a <=69 and $a>=50){
echo "丙";
}
if($a <=49 and $a>=0){
echo "丁";
}
if ($a >100 or $a <0 p=""> echo "輸入超出範圍";
}
else{}
?>
0>
2、
$a=78;
if($a <=100 and $a >=90){
echo "甲";
}
elseif($a <=89 and $a >=70 ){
echo "乙";
}
elseif($a <=69 and $a>=50){
echo "丙";
}
elseif($a <=49 and $a>=0){
echo "丁";
}
elseif($a >100 or $a <0 p=""> echo "輸入超出範圍";
}
else{}
?>
0>
3、
$a=78;
switch($a){
case($a <=100 and $a >=90):
echo "甲";
break;
case($a <=89 and $a >=70):
echo "乙";
break;
case($a <=69 and $a>=50):
echo "丙";
break;
case($a <=49 and $a>=0):
echo "丁";
break;
case($a >100 or $a <0 p=""> echo "輸入超出範圍";
break;
default:
break;
}
?>
0>
沒有留言:
張貼留言