给儿子用,每天一百道,哈哈哈
Sub add_ranknum()Dim num1 As Integer, num2 As Integer, num3 As Integer, temp As Integer
Dim operat As StringFor c = 1 To 10 Step 2
For i = 1 To 20
NX:Randomizenum1 = Rnd * 99num2 = Rnd * 99If num1 = num2 Then GoTo NXIf num1 < 10 Or num2 < 10 Then GoTo NXnum3 = Rnd If num3 = 1 Thenoperat = "+"Elseoperat = "-"If num1 < num2 Thentemp = num1num1 = num2num2 = tempEnd If End IfCells(i, c) = num1 & operat & num2 & "="Next i
Next cEnd Sub
效果: