我如何使用for循环来获得添加结果? [关闭]
问题描述:
My math query is (1+5+ 10+15+20+25 =?)
How I use for loop to get the addition result?
我的数学查询是(1 + 5 + 10 + 15 + 20 + 25 =?) p>
我如何使用for循环来获得添加结果? p> div>
答
$answer = 1;
for($x=1;$x<6;$x++){
$answer+=5*$x;
}
echo $answer;