vb题(好的可以追加分)急急急~~!!!!
答案:1 悬赏:70 手机版
解决时间 2021-04-22 09:58
- 提问者网友:轮囘Li巡影
- 2021-04-21 19:54
单击窗口,随机产生10个两位数放入数组中,统计其偶数个数,并用消息框输出
最佳答案
- 五星知识达人网友:痴妹与他
- 2021-04-21 20:21
Private Sub Form_Click()
Cls
Dim a(9) As Byte, k As Byte, l As Byte
For k = 0 To 9
a(k) = Int(Rnd * 255)
Print a(k)
If a(k) Mod 2 = 0 Then l = l + 1
Next k
'
MsgBox "共有 " & l & " 个偶数"
End Sub
Cls
Dim a(9) As Byte, k As Byte, l As Byte
For k = 0 To 9
a(k) = Int(Rnd * 255)
Print a(k)
If a(k) Mod 2 = 0 Then l = l + 1
Next k
'
MsgBox "共有 " & l & " 个偶数"
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯