时间:2021-07-01 10:21:17 帮助过:4人阅读
function Contrast($arr,$r,$c,&$numb){
if($arr[$r][$c]==$arr[$r][$c+1]){
$c++;
$numb++;
Contrast($arr,$r,$c,$numb);
}else{
echo $numb."";
return $numb;
}
}
$arr=array(array(0,0,0,1,1,1,1,1,1,0,0,));
$r=0;
$c=3;
$numb=0;
$d=Contrast($arr,$r,$c,$numb);
var_dump($d);
?>
if($arr[$r][$c]==$arr[$r][$c+1]){
$c++;
$numb++;
Contrast($arr,$r,$c,$numb);
}else{
function Contrast($arr,$r,$c,&$numb){
if($arr[$r][$c]==$arr[$r][$c+1]){
$c++;
$numb++;
return Contrast($arr,$r,$c,$numb);
}else{
echo $numb."";
return $numb;
}
}
$arr=array(array(0,0,0,1,1,1,1,1,1,0,0,));
$r=0;
$c=3;
$numb=0;
$d=Contrast($arr,$r,$c,$numb);
var_dump($d);
?>