taiwanplope
|
分享:
▲
▼
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim 姓名() = {"吴国民", "李得胜", "蔡可申", "陈梦娇", "方十全"} Dim 评分(,) = {{77, 78, 78, 84, 84, 79, 77, 76, 76, 81}, _ {89, 89, 92, 88, 91, 87, 86, 90, 85, 89}, _ {89, 82, 87, 83, 82, 89, 86, 86, 84, 80}, _ {86, 86, 90, 89, 81, 86, 90, 85, 87, 86}, _ {89, 88, 87, 88, 86, 84, 86, 93, 84, 87}}
Dim maxidx As Integer = UBound(姓名), maxidx2 As Integer Dim 平均(maxidx), minv, maxv As Double
For i = 0 To maxidx minv = 评分(i, 0) maxv = 评分(i, 0) maxidx2 = UBound(评分, 2)
For j = 0 To maxidx2 If minv > 评分(i, j) Then minv = 评分(i, j) If maxv < 评分(i, j) Then maxv = 评分(i, j) 平均(i) += 评分(i, j) Next
平均(i) = Math.Round((平均(i) - minv - maxv) / (maxidx2 - 1), 2) Next
Array.Sort(平均, 姓名)
Dim m As String = "" For i = maxidx To 0 Step -1 m &= (maxidx - i + 1) & ": " & 姓名(i) & " " & 平均(i) & vbCrLf Next MsgBox(m) End End Sub End Class
程式码送上 PS. 三仙 帮我解 = . = 外面那个猜数字 !!!!!!
|