07_ for 练习 _ sumOfOdd
-
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Sum of Odd/Even</title> </head> <body> <script type="text/javascript"> var sumOdd = 0; var sumEven = 0; var i; for(i=1; i<=100; i++) { if(i%2 != 0) { sumOdd += i; } else { sumEven += i; } } document.write("The sum of 1~100 odd is "+sumOdd+"<br />"); document.write("The sum of 1~100 even is "+sumEven+"<br />"); </script> </body> </html>
--------小尾巴
________一个人欣赏-最后一朵颜色的消逝-忠诚于我的是·一颗叫做野的心.决不受人奴役.怒火中生的那一刻·终将结束...