vb,输出任意10个数中负数的个数,偶数的个数,奇偶数的和

匿名网友 |浏览602次
收藏|2020/04/29 09:04

满意回答

2020/04/29 09:29

程序多个错,改好的参考Private Sub Command1_Click()Dim a(10) As Long, i As Integer, x As Integer, y As Integer, n As Integerx = 0y = 0n = 0For i = 0 To 9a(i) = InputBox("请输入任意数字")If a(i) < 0 Then x = x + 1If a(i) Mod 2 = 0 Then y = y + 1 Else n = n + 1NextMsgBox ("负数的个数" & Str(x) & "偶数的个数" & Str(y) & "奇偶数的个数" & Str(n))End Sub

whoami1978

其他回答(0)
0人关注该问题
+1

 加载中...