a = document.CPU.Bfirst.value;
w = document.CPU.Afirst.value;
aa = a + w;
k = aa.sub();
document.write(k);
*我想要下标形式的两个值之和,但它只提供连接值而不是实际总和。
*其他变量:
a = document.CPU.Bfirst.value;
b = document.CPU.Bsecond.value;
c = document.CPU.Bthird.value;
d = document.CPU.Bfourth.value;
w = document.CPU.Afirst.value;
x = document.CPU.Asecond.value;
y = document.CPU.Athird.value;
z = document.CPU.Afourth.value;
e = a - w;
f = b - x;
g = c - y;
h = d - z;
i = (e + f + g + h)/4;
aa = a + w;
bb = aa + x;
cc = bb + y;
dd = cc + z;
j = w.sub();
k = aa.sub();
l = bb.sub();
m = cc.sub();
n = dd.sub();
*表格部分:
Enter all needed information:
Process Arrival Time Burst Time A B C D
答案 0 :(得分:2)
如果您的值确实是数字,则可以使用一元+
运算符强制转换:
aa = +a + +w;
value
节点的<input>
属性将始终为您提供字符串,JavaScript +
运算符非常喜欢字符串。
答案 1 :(得分:2)