题型:综合题 题类:模拟题 难易度:困难
浙江省教育绿色评价联盟2020届高三信息技术6月适应性考试试卷
班级 |
1班 |
2班 |
3班 |
4班 |
5班 |
6班 |
7班 |
8班 |
9班 |
10班 |
人数 |
50 |
45 |
50 |
51 |
49 |
55 |
50 |
48 |
52 |
50 |
Const n = 500 '总学生数
Const m = 10 '总班级数Dim score(1 To n) As Integer
Dim stu_name(1 To n) As Integer Dim class(1 To n) As Integer Dim temp1(1 To n) As Integer Dim temp2(1 To n) As Integer Dim temp3(1 To n) As Integer Function adj(s As String)
'本函数在字符串s 前添加若干空格,实现右对齐,代码略
End Function
Private Sub Form_Load()
'本过程读取学生姓名、班级和成绩数据分别存储在数组stu_name,class 和score 中,
'并在 List1 中显示,代码略
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer, t1 As Integer, t2 As String
Dim c(0 To m + 1) As Integer
For i = 0 To m
c(i) = 0
Next i
For i = 1 To n
c(k) = c(k) + 1
Next i
For i = 1 To m
c(i) = c(i) + c(i - 1)
Next i
For i = n To 1 Step -1
k = class(i)
temp1(c(k)) = score(i)
temp2(c(k)) = stu_name(i)
temp3(c(k)) = class(i)
Next i '处理完毕 c(i+1)表示第 i 个班级的最后一个学生的存储位置
c(m + 1) = n
For k = 1 To m '对每一个班级学生成绩进行排序For i = c(k) + 1 To c(k + 1) - 1
For j = c(k + 1) To i + 1 Step -1
If Then
t1 = temp1(j): temp1(j) = temp1(j - 1): temp1(j - 1) = t1
t2 = temp2(j): temp2(j) = temp2(j - 1): temp2(j - 1) = t2
t1 = temp3(j): temp3(j) = temp3(j - 1): temp3(j - 1) = t1
End If
Next j
Next i
Next k
For i = 1 To n
score(i) = temp1(i): stu_name(i) = temp2(i): class(i) = temp3(i)
List2.AddItem adj(Str(stu_name(i))) & adj(Str(class(i))) & adj(Str(score(i)))
Next i
End Sub
试题篮