统计数字字符的个数(01 统计数字字符个数)

溥波士
导读 大家好,乐天来为大家解答以下的问题,关于统计数字字符的个数,01 统计数字字符个数这个很多人还不知道,现在让我们一起来看看吧!1、Priva...

大家好,乐天来为大家解答以下的问题,关于统计数字字符的个数,01 统计数字字符个数这个很多人还不知道,现在让我们一起来看看吧!

1、Private Sub Command1_Click() Dim a(1 To 30) Dim c(0 To 9) Dim i As Integer Picture1.Cls For i = 1 To 30 a(i) = Mid(Text1.Text, i, 1) Next i For i = 0 To 9 c(i) = 0 Next i CountN a, c For i = 0 To 9 Picture1.Print "数字" & i & ":" & c(i) & "次" Next i End Sub Private Sub Form_Load() Dim i As Integer Command1.Caption = "统计" Randomize Timer Text1.Text = "" For i = 1 To 30 Text1.Text = Text1.Text & Int(Rnd() * 10) Next i End Sub Sub CountN(a(), count()) Dim i As Integer For i = LBound(a) To UBound(a) count(Val(a(i))) = count(Val(a(i))) + 1 Next i End Sub。

本文分享完毕,希望对大家有所帮助。

标签:

免责声明:本文由用户上传,如有侵权请联系删除!