麻烦老师检查,谢谢
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>综合算法</title> </head> <body> <script> //补充代码 //购买方案数 var count = 0; //毛巾、牙刷、牙膏数量 var towel = 0, toothbrush = 0, toothpaste = 0; for(var i = 0; i <= 20; i += 2){ //小星星的钱 var sum = 100; sum -= i * 5; for(var j = 0; j <= 50; j += 5){ sum -= j * 2; for(var k = 0; k <= 10; k++){ if(sum % 10 == 0){ count++; } } } } console.log("购买方案的次数:" + count); </script> </body> </html>
9
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星