握有一串数组,78, 63 61,55,40,32 ,23,按从大到小排列,现在想计算出他在98%处的的值,谁能告诉我在VB中的这个函数,以及怎样用,谢谢各位!!!!

解决方案 »

  1.   

    数组的最大下标*0.98,取整
    dim x()
    n=100
    redim x(1 to n)
    u =ubound(x)
    m=int(u*0.98)
    msgbox x(m)
      

  2.   

    dim num() as integer
    dim numall as integer
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        if keyascii=13 then
            numall=numall+1
            ReDim Preserve num(1 to numall) as integer
            num(numall)=val(text1.text)
        end if
    end sub
    private sub command1_click()
        int a as integer
        a=int(numall*98/100)
        magbox "%98处数据为" & num(a)
    end sub