do{
var now = parseInt(window.prompt("输入第"+(strs.length+1)+"个数的值:"))
var m = 0
var n = 0
if( now == 0 ){break}
strs.push(now)
for (var i=0i<strs.length i++ ){
if(strs[i] >0){
m = m + strs[i]
}else{
n = n + strs[i]
}
}
document.write("正数和为:"+m+"<br/>")
document.write("负数和为:"+n+"<br/>")
}while(true)
function(){var sumNum=0//记录和的变量
for(var i=1i<=100i++){
sumNum+=i//累加上次的值
}
alert('1+2+3+....+99+100='+sumNum)//输出和
}
<script>function dd(){for(var i=0i<2i++){var op+="sdfsd"}
alert(op)
}
dd()</script>