以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何提取字典数据最大值  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188835)

--  作者:ZJZK2018
--  发布时间:2023/10/23 10:59:00
--  如何提取字典数据最大值

Dim zd As New Dictionary(Of Integer, String)


如何提取字典Key的最大值,Key中有:5,2,8,1,15,4有N个数


--  作者:有点蓝
--  发布时间:2023/10/23 11:20:00
--  
Dim max As Integer = 0
For Each i As Integer In zd.Keys
    If i > max Then
        max = i
    End If 
Next
MsgBox(max)

--  作者:y2287958
--  发布时间:2023/10/23 11:38:00
--  
Output .Show (zd.Keys .max)
--  作者:ZJZK2018
--  发布时间:2023/10/23 13:10:00
--  
不好意思,最小值如何求??
--  作者:有点蓝
--  发布时间:2023/10/23 14:11:00
--  
min