数学程序计算编写一个程序计算 1^2 + 3^2 + 5^2 +.99^2
2019-04-13
数学程序计算
编写一个程序计算 1^2 + 3^2 + 5^2 +.99^2
优质解答
这是用vb6编的:
Dim n As Single,s As Long
s = 0
For n = 1 To 99 Step 2
s = s + n ^ 2
Next n
Print s
这是用vb6编的:
Dim n As Single,s As Long
s = 0
For n = 1 To 99 Step 2
s = s + n ^ 2
Next n
Print s