用<script></script>
var sum = 0;
for(var i = 1; i < 51; i+=2){
sum += i;
}
alert(sum);
function sum(){ var x=0; for(var i=1;i<50;i+=2){ x+=i; } return x; }