隋唐人的图片:用asp循环来做一道1*到99奇数相乘的题?

来源:百度文库 编辑:中科新闻网 时间:2024/05/13 06:05:40
s=1^2+3^2+5^2+……+99^2,请利用两种循环语句编写程序,计算s的值。
提示:注意步长。

n=99
s=0
for i=1 to n step 2
s=s+i^2
next

s=0
i=1
do while i<=n
s=s+i^2
i=i+2
loop

for i=0 to 99
if i%2 then
end if
next

while,我记不住了,好长时间没写