时间:2021-07-01 10:21:17 帮助过:26人阅读
[php]
function jiafa($a,$b)
{
for($i=0;$i<$b;$i++)
{
$a++;
}
return $a;
}
//echo jiafa(4,2);
减法
[php]
function jianfa($a,$b)
{
$c=0;
while($b!=$a)
{
$b++;
$c++;
}
echo $c;
} // end func
//jianfa(10,3);
乘法
[php]
function chengfa($a,$b)
{
$c=0;
for($j=0;$j<$b;$j++)
{
$c=jiafa($c,$a);
}
return $c;
} // end func
//chengfa(9,3);
除法
[php]
function chufa($d,$e)
{
$k=0;
$f=0;
while($f<$d)
{
$k++;
$f=chengfa($e,$k);
}
return $k;
} // end func
echo chufa(16,2);
http://www.bkjia.com/PHPjc/477889.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477889.htmlTechArticle加法 [php] function jiafa($a,$b) { for($i=0;$i$b;$i++) { $a++; } return $a; } //echo jiafa(4,2); 减法 [php] function jianfa($a,$b) { $c=0; while($b!=$a) { $b++; $c++; } echo $c...