vb.net 统计数组中相同数字的个数
统计数组中相同的字符串以及重复的次数例如:c,4,km,3,e9,f,s2,5,39,f,s输出结果为:9,f,s出现的次数为2c,4,km,3,e9,f,s2,5,32...
统计数组中相同的字符串以及重复的次数
例如:
c,4,k
m,3,e
9,f,s
2,5,3
9,f,s
输出结果为:
9,f,s出现的次数为2
c,4,k
m,3,e
9,f,s
2,5,3
2,5,3
9,f,s
2,5,3
输出结果为:
9,f,s出现的次数为2
2,5,3出现的次数为3
请老师指点下谢谢 用vb.NET 展开
例如:
c,4,k
m,3,e
9,f,s
2,5,3
9,f,s
输出结果为:
9,f,s出现的次数为2
c,4,k
m,3,e
9,f,s
2,5,3
2,5,3
9,f,s
2,5,3
输出结果为:
9,f,s出现的次数为2
2,5,3出现的次数为3
请老师指点下谢谢 用vb.NET 展开
1个回答
展开全部
Private Sub Form_Click()
Dim a(3) As Integer
Dim m As Boolean
m = True
For i = 0 To 3
a(i) = 1
Next i
For i = 0 To UBound(a)
If a(i) <> 1 Then
m = False
Exit For
End If
Next i
If m = True Then
Print "全部符合"
Else
Print "不全部符合"
End If
End Sub
Dim a(3) As Integer
Dim m As Boolean
m = True
For i = 0 To 3
a(i) = 1
Next i
For i = 0 To UBound(a)
If a(i) <> 1 Then
m = False
Exit For
End If
Next i
If m = True Then
Print "全部符合"
Else
Print "不全部符合"
End If
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询