class jisuan{
public $count2;
function inmoney($money)
{
$count2=0;
$count=$money/2;
$e=$count;
$g=$count;
if($e>=2 || $e>=4){
$count3=self::check($e,$g);
$count+=$count3;
}
return $count;
}
public function check($e,$g)
{ global $count2;
$count2+=floor($e/2);$g+=floor($e/2);$ez=floor($e/2);$e=$e%2+$ez;
$count2+=floor($g/4);$e+=floor($g/4);$gz=floor($g/4);$g=$g%4+$gz;
if($e>=2 || $g>=4){self::check($e,$g);}
return $count2;
}
}
$resu=new jisuan();
echo $resu->inmoney(10);