不是很明白sum=sum+mymoney 最后循环十次想家得55?
看透不说透
看透不说透 2016-12-20 11:59:22
0
2
1056

还有声明的时候声明的时候只 var sum;

为什么sum=sum+mymoney=110


看透不说透
看透不说透

reply all(2)
数据分析师

Don’t quite understand that sum=sum+mymoney lasts ten times and gets 55 homesickness? -PHP Chinese website Q&A-I don’t quite understand sum=sum+mymoney. Finally, after looping ten times, I get 55 homesickness? -PHP Chinese website Q&A

Please watch and learn.

迷茫

sum的初始值为0,mymoney的初始值为1时,

sum=sum+mymoney=0+1=1;

mymoney++=1+1=2;

sum=sum+mymoney=1+2=3;

一直循环下去,最后sum就是55啊。

如果最后sum等于110,那就要看你的mymoney的初始值和每次递增的度是多少了。


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!