do..while..若执行一次后while条件满足 do{}里面需要怎么添加代码?
phpcn_u224
phpcn_u224 2016-12-19 17:36:01
0
2
1144
$num=2;
$sum=10;
do{
$sum=$sum+10;
//需要添加什么代码
     }while($num>0)
echo $sum;


phpcn_u224
phpcn_u224

reply all(2)
数据分析师

do..while..If the while condition is satisfied after executing it once, how do I need to add code to do{}? -PHP Chinese website Q&A-do..while..If the while condition is satisfied after executing once, how do I need to add code to do{}? -PHP Chinese website Q&A

Please watch and learn.

阿神

do里面是执行  while是条件 不管第一次while的条件有没有合适 都会先执行一次do    第一次$sum是20;应该num本身就大于0,所以会一直执行   如果只想执行一次的话 while($num<2)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template