问答详情
源自:4-5 重复重复(for循环)

为什么不通过呀

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>if...else</title>

<script type="text/JavaScript">

var mymoney,sum=0;//mymoney变量存放不同面值,sum总计

for(mymoney=1;mymoney<11;mymoney++)

  sum= sum + mymoney;

}

  document.write("sum合计:"+sum);

</script>

</head>

<body>

</body>

</html>


提问者:weixin_慕侠0104744 2022-09-10 14:06

个回答

  • weixin_慕姐6425296
    2022-09-14 10:41:41

    for(mymoney=1;mymoney<11;mymoney++)

    改成

    for(mymoney=1;mymoney<=10;mymoney++)就可以了