|
瞎写一个- Sub Main()
- Dim ar(1 To 100, 1 To 3)
-
- For i = 1 To UBound(ar)
- For j = 1 To UBound(ar, 2)
- ar(i, j) = GetABC
- Next
- Next
- Range("b2").Resize(100, 3).Value = ar
- End Sub
- Function GetABC()
- Randomize
- Dim a%, b%, c%, d%
- Const n As Long = 29
- a = Rnd * n + 1
- b = Rnd * n + 1
- If a + b > n Then
- c = a + b - n
- c = Rnd * (n - c) + c
- Else
- c = Rnd * n + 1
- End If
- d = Rnd * 3 + 1
- Select Case d
- Case 1: GetABC = "( )+" & c & "=" & b & "+" & a
- Case 2: GetABC = c & "+( )=" & b & "+" & a
- Case 3: GetABC = a & "+" & b & "=( )+" & c
- Case 4: GetABC = a & "+" & b & "=" & c & "+( )"
- End Select
- End Function
复制代码 |
评分
-
1
查看全部评分
-
|