4个回答
展开全部
Private Sub Command1_Click()
Dim n As Integer, i As Integer, s As Long
n = Val(Text1.Text)
If n < 1 Then
Label1.Caption = \"输入错误\"
Else
s = 0
For i = 1 To n Step 1
s = s + i * (i + 1) * (i + 2)
Next i
Label1.Caption = s
End If
End Sub
Dim n As Integer, i As Integer, s As Long
n = Val(Text1.Text)
If n < 1 Then
Label1.Caption = \"输入错误\"
Else
s = 0
For i = 1 To n Step 1
s = s + i * (i + 1) * (i + 2)
Next i
Label1.Caption = s
End If
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
VB不怎么擅长
C的怎么样,原理应该差不多
int n;
long sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++) sum+=i*(i+1)*(i+2);
printf("sum is %d",sum);
C的怎么样,原理应该差不多
int n;
long sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++) sum+=i*(i+1)*(i+2);
printf("sum is %d",sum);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private
Sub
Command1_Click()
Dim
i
As
Integer,
s
As
Long
s
=
0
For
i
=
1
To
Int(Text1.Text)
s
=
s
+
(i
*
(i
+
1)
*
(i
+
2))
Next
i
print
s
End
Sub
Sub
Command1_Click()
Dim
i
As
Integer,
s
As
Long
s
=
0
For
i
=
1
To
Int(Text1.Text)
s
=
s
+
(i
*
(i
+
1)
*
(i
+
2))
Next
i
s
End
Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim n As Integer
Dim s As Long
s = 1
n = Val(Text1.Text)
For n = n + 2 To 1 Step -1
s = s * n
Next n
Print s
End Sub
Dim n As Integer
Dim s As Long
s = 1
n = Val(Text1.Text)
For n = n + 2 To 1 Step -1
s = s * n
Next n
Print s
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询