题型:综合题 题类:常考题 难易度:困难
浙江省台州市书生中学2016-2017学年高二下学期信息技术第一次月考试卷
Dim xse(1 To 3000) As Long '存储销售员工的销售量,最大处理个数为3000
Dim xm(1 To 3000) As String '存储销售员工的姓名
Dim mc(1 To 3000) As Integer '存储销售员工的名次
Dim num As Integer '当前员工总数
Private Sub Form_Load()
'将销售量、姓名数据存入xse和xm数组
'计算员工总数num
'代码略
End Sub
Private Sub Command1_Click()
Dim sum As Long
Dim i As Integer, flag As Integer
pm = Val(Text2.Text)
dq = Text1.Text
sum = 0
For i = 1 To num
sum = sum + xse(i)
Next i
For i = 1 To pm '对员工销售量进行排序
For j = To i + 1 Step -1
If xse(j - 1) < xse(j) Then
t = xse(j - 1): xse (j - 1) = xse(j): xse(j) = t
st = xm(j - 1): xm(j - 1) = xm(j): xm(j) = st
End If
Next j
Next i
mc(1) = 1
For i = 2 To pm
If Then
mc(i) = mc(i - 1)
Else
mc(i) = i
End If
Next i
List1.Clear
List1.AddItem "排名" + "姓名" + "销售量"
For i = 1 To pm
List1.AddItem Str(mc(i)) + " " + xm(i) + " " + Str(xse(i))
Next i
List1.AddItem dq + "平均销售额约为:" +
End Sub
试题篮