$num=2; $sum=10; do{ $sum=$sum+10; //需要添加什么代码 }while($num>0) echo $sum;
数据分析师2017-09-30 23:00:52
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.
阿神2016-12-19 17:36:17
do里面是执行 while是条件 不管第一次while的条件有没有合适 都会先执行一次do 第一次$sum是20;应该num本身就大于0,所以会一直执行 如果只想执行一次的话 while($num<2)