我有以下一段代码
var total = 5;
var arr = new Array("750", "400", "432", "355", "263");
id = 0;
num = 100;
var ht = 310;
var max = 750;
var cm = 20;
var bHg = 0;
var wdt = 100;
var bm = 20;
for (var i = 0; i < total; i++) {
ar = parseInt(arr[i]);
// how to rewrite these equations
**bHg = (ar * ht / max) / num * id;
printfu(cm + 50 + (i * (wdt + bm)) + bm,
cm + (ht - bHg), wdt, bHg);**
}
function printfu(a,b,c,d) {
document.write(a + b + c + d + "\n");
}
从学习的目的来看,我怎样才能用不同的方程写两行来产生相同的输出
bHg = (ar * ht / max) / num * id;
printfu(cm + 50 + (i * (wdt + bm)) + bm, cm + (ht - bHg), wdt, bHg);
以上的输出
520 640 760 880 1000