VB题 急求 编程求S=1눀+2눀+3눀+......+N눀(其中N的值要求用键盘输入)

2024-11-06 20:33:13
推荐回答(3个)
回答1:

Dim N As Long
Dim i As Long

N = Val(InputBox("请输入数字 ", "输入数字"))
For i = 1 To N
s = s + i ^ 2
Next

MsgBox s

回答2:

昏暗的N作为长
点我只要

N = VAL(输入框(“请输入一个数字”,“输入号码”))

对于i = 1到n

S = S + I ^ 2

MsgBox的

回答3:

a=0
for i := 1 to n do
begin
a := a + i*i;
end
showmessage(a)