1个回答
展开全部
Private Sub Command1_Click()
Dim i, temp, a1, a2, a3 As Integer
For i = 1 To 10
temp = Val(InputBox("请输入:"))
If temp > 0 Then
a1 = a1 + 1
ElseIf temp < 0 Then
a2 = a2 + 1
Else
a3 = a3 + 1
End If
Next
Print "正数的个数:" & a1
Print "负数的个数:" & a2
Print "零的个数:" & a3
End Sub
Dim i, temp, a1, a2, a3 As Integer
For i = 1 To 10
temp = Val(InputBox("请输入:"))
If temp > 0 Then
a1 = a1 + 1
ElseIf temp < 0 Then
a2 = a2 + 1
Else
a3 = a3 + 1
End If
Next
Print "正数的个数:" & a1
Print "负数的个数:" & a2
Print "零的个数:" & a3
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |