VB怎么编写【m,n】之间奇数平方和语句
dim i ,慎如s as Integer
s=0
for i=m to n
if i mod 2=1 then
s=s+i*i
end if
next i
print “m到n区间的液孝乱平方和是:闹档”,s
m和n的取值自己在for i=m to n这里改。
dim m,n as integer
Dim Cnt As Integer
For Cnt = m To n
if Cnt % 2 !=0 then
debug.print Cnt*Cnt
end if
Next Cnt
m=1
n=100
for i=m to n
if i mod 2<>0 then sum=sum + i^2
next