<?php
$n = 3;
$t = 100;
$c = 2;
$a = [1,2,3];
$count = 0;
if($n>$c){
for($i=0;$c<=$n-$i;$i++){
$total = 0;
$countA = 0;
for($j=0;$countA<$c;$j++){
$total = $total + $a[$j];
$countA = $countA+1;
}
if($total<=$t && $countA == $c){
$count = $count +1;
}
}
echo($count);
}else{
echo "data err";
}
热门评论
22222222222222222222222222222