Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=92386
Postga havola
Akbarali [2384] [off]
End, # End (02.06.2022 / 11:18)
Akbarali,
$n=$_POST['n'];
$j=0;
$t=0;
for ($i=1; $i<=$n; $i++){
If ($i%2==0){ $juft[$j]=$i; $j++ }
else { $toq[$t]=$i; $t++; }
}
Shunda sonlar $juft $toq massivlariga ajratiladi
bu yaxshi variyant emas kodni qisqartirish kerak optimallashtirish kerak
Akbarali,
$n=$_POST['n'];
$j=0;
$t=0;
for ($i=1; $i<=$n; $i++){
If ($i%2==0){ $juft[$j]=$i; $j++ }
else { $toq[$t]=$i; $t++; }
}
Shunda sonlar $juft $toq massivlariga ajratiladi
bu yaxshi variyant emas kodni qisqartirish kerak optimallashtirish kerak