PHP Notice: Undefined variable: sum in index.php on line 8 PHP Notice: Undefined variable: sum in index.php on line 12 总分: 平均分:0 数学比英语高的分数:8 英语成绩的平方:12100
<?php
$english = 110; //英语成绩
$math= 118; //数学成绩
$biological = 80; //生物成绩
$physical = 90; //物理成绩
$sun=$english+$math+$biological+$physical;
$avg=$sum / 4;
$x=$math-$english;
$x2=$english*$english;
echo "总分:".$sum."<br />";
echo "平均分:".$avg."<br />";
echo "数学比英语高的分数:".$x."<br />";
echo "英语成绩的平方:".$x2."<br />";