完成了随机出题的代码,实现了筛选不符合要求的数组。
剩下的就是页面制作和一些简单判断。
剩下的就是页面制作和一些简单判断。
Dim x%, y%, p%
Dim a(1 To 10) As Integer
Dim b(1 To 10) As Integer
Dim s(1 To 10) As Integer
Randomize
For i = 1 To 10
s(i) = Int(4 * Rnd) + 1
x = Int(9 * Rnd) + 1
y = Int(9 * Rnd) + 1
Select Case s(i)
Case 1
a(i) = x
b(i) = y
Case 2
x = Int(9 * Rnd) + 1
y = Int(9 * Rnd) + 1
a(i) = x
b(i) = y
If a(i) < b(i) Then
p = a(i)
a(i) = b(i)
b(i) = p
End If
Case 3
a(i) = x
b(i) = y
Case 4
a(i) = x
b(i) = y
If a(i) < b(i) Then
p = a(i)
a(i) = b(i)
b(i) = p
End If
If a(i) Mod b(i) <> 0 Then
i = i - 1
End If
End Select
Next
Print s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8), s(9), s(10)
Print a(1), a(2), a(3), a(4), a(5), a(6), a(7), a(8), a(9), a(10)
Print b(1), b(2), b(3), b(4), b(5), b(6), b(7), b(8), b(9), b(10)
Dim a(1 To 10) As Integer
Dim b(1 To 10) As Integer
Dim s(1 To 10) As Integer
Randomize
For i = 1 To 10
s(i) = Int(4 * Rnd) + 1
x = Int(9 * Rnd) + 1
y = Int(9 * Rnd) + 1
Select Case s(i)
Case 1
a(i) = x
b(i) = y
Case 2
x = Int(9 * Rnd) + 1
y = Int(9 * Rnd) + 1
a(i) = x
b(i) = y
If a(i) < b(i) Then
p = a(i)
a(i) = b(i)
b(i) = p
End If
Case 3
a(i) = x
b(i) = y
Case 4
a(i) = x
b(i) = y
If a(i) < b(i) Then
p = a(i)
a(i) = b(i)
b(i) = p
End If
If a(i) Mod b(i) <> 0 Then
i = i - 1
End If
End Select
Next
Print s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8), s(9), s(10)
Print a(1), a(2), a(3), a(4), a(5), a(6), a(7), a(8), a(9), a(10)
Print b(1), b(2), b(3), b(4), b(5), b(6), b(7), b(8), b(9), b(10)