答案:<script language="javascript">
var result = 0;
for (i=1;i<=100;i+=2)
{
result=result+i;
}
alert(result);
</script><script language="javascript">
var result = 0;
for (i=1;i<=100;i++){
if (i%2 == 0)
{
result=result+i;
}
}
alert(result);
</script><script language="javascript">
var result;
for (result =1;result <=100;result ++)
{if (result %2 == 0)
{
result+=result
}
}alert(result);</script>
上一个:如何给gridview里的“数量”中textbox添加事件,当它值改变时,总金额里值做相应改变。用javascript脚本做
下一个:用脚本语言强势关闭窗口