用面向对象求两圆面积差
用面向对象求一个半径为10的圆比一个半径为5的圆大多少
class Yuan
{
public $a;
function __construct($bj)
{
$this->a = $bj;
}
function mianJi()
{
return 3.14*$this->a*$this->a;
}
}
$ab = new Yuan(10);
$ac = new Yuan(5);
$zmj = $ab->mianJi()-$ac->mianJi();
echo $zmj;