求和
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script> var sum=0; for(var i=1;i<=99;i++){ if(i%2==1){ sum=sum+i; } } alert(sum); </script> <script> var num=0; for(var j=1;j<=100;j++){ if(j%2==0){ num+=j; } } document.write(num); </script> </body> </html>