<?php
$num1 = 28;
$num2 =13;
function numSum($num){
$sum = 0;
for($i=$num-1;$i>0;$i--){
//echo $i;
if($num % $i == 0){
$sum = $sum + $i;
}
}
if($sum == $num){
echo 1;
}else{
echo 0;
}
}
numSum($num1);
numSum($num2);
<?php
$num1 = 28;
$num2 =13;
function numSum($num){
$sum = 0;
for($i=$num-1;$i>0;$i--){
//echo $i;
if($num % $i == 0){
$sum = $sum + $i;
}
}
if($sum == $num){
echo 1;
}else{
echo 0;
}
}
numSum($num1);
numSum($num2);
热门评论
1010101010