vbs實現的簡易評分程序

一、源碼

xuanshou=inputbox("請輸入選手姓名,如:","選手姓名","郭靖")
s=split(trim(inputbox("請依次輸入評委打分,分別用「空格」隔開。如:","提示","90 98 87 99 91.2 93 87.5 89 89.5"))," ")
l=ubound(s):redim p(l):zongfen=0

for i=0 to l
sn = sn & "第" & i+1 & "評委:" & s(i) & vbcrlf
next
for i=0 to l
    for j=i to l
      if ccur(s(i))>ccur(s(j)) then
        tmp=s(i):s(i)=s(j):s(j)=tmp
      end if
    next
next
for i=1 to l-1
zongfen=zongfen+s(i)
next
msgbox xuanshou & vbcrlf &"-------------------------------------" _
& vbcrlf & sn & "-------------------------------------" _
& vbcrlf &    "去掉一個最高分:【" & s(l) & "分】" _
& vbcrlf &    "去掉一個最低分:〖" & s(0) & "分〗" _
& vbcrlf &    "最後得分:〖" & round(zongfen/(l-1),2) & "分〗",4096,"統計結果"

二、演示

相關文章
相關標籤/搜索