Dim a1 As Integer, a2 As Integer
Dim b1 As Integer, b2 As Integer
Dim c1 As Integer, c2 As Integer
Dim c As Integer, daan As Integer
Dim s1 As String, s2 As String
Sub jiajian()
Randomize
sel:
a1 = Rnd * 8 + 1
a2 = Rnd * 9
b1 = Rnd * 8 + 1
b2 = Rnd * 9
c = 100 * Rnd
a = (-1) ^ c
With ActivePresentation.Slides(1)
If .Shapes("chuti").TextFrame.TextRange.Text = "出 题" Then
.Shapes("sw").TextFrame.TextRange.Text = ""
.Shapes("jw").TextFrame.TextRange.Text = ""
If a = 1 Then
.Shapes("sign").TextFrame.TextRange.Text = "+"
If a1 + b1 < 9 Then
s2 = ""
If a2 + b2 >= 10 Then
s1 = "1"
Else
s1 = ""
End If
Else
GoTo sel
End If
daan = 10 * a1 + a2 + 10 * b1 + b2
c1 = daan \ 10
c2 = daan Mod 10
Else
.Shapes("sign").TextFrame.TextRange.Text = "-"
If a1 > b1 Then
s1 = ""
If a2 < b2 Then
s2 = "·"
Else
s2 = ""
End If
Else
GoTo sel
End If
daan = 10 * a1 + a2 - 10 * b1 - b2
c1 = daan \ 10
c2 = daan Mod 10
If c1 = 0 Then GoTo sel
End If
.Shapes("a1").TextFrame.TextRange.Text = a1
.Shapes("a2").TextFrame.TextRange.Text = a2
.Shapes("b1").TextFrame.TextRange.Text = b1
.Shapes("b2").TextFrame.TextRange.Text = b2
.Shapes("c1").TextFrame.TextRange.Text = ""
.Shapes("c2").TextFrame.TextRange.Text = ""
.Shapes("chuti").TextFrame.TextRange.Text = "看答案"
Else
.Shapes("c1").TextFrame.TextRange.Text = c1
.Shapes("c2").TextFrame.TextRange.Text = c2
.Shapes("jw").TextFrame.TextRange.Text = s1
.Shapes("sw").TextFrame.TextRange.Text = s2
.Shapes("chuti").TextFrame.TextRange.Text = "出 题"
End If
End With
End Sub
12.9 KB, 下载次数: 68)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
12.9 KB, 下载次数: 56)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
16.8 KB, 下载次数: 51)
[ 本帖最后由 远离抱怨 于 2011-8-17 22:05 编辑 ]
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
296 KB, 下载次数: 60)
(2011-08-17 22:06:36, Size: 92.1 KB, Downloads: 66)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
132 KB, 下载次数: 62)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
73.7 KB, 下载次数: 46)
幻灯片1.PNG
幻灯片2.PNG
幻灯片3.PNG
幻灯片4.PNG
888 B , 下载次数: 70)
两位数的加减.jpg
467 KB, 下载次数: 49)
幻灯片1.PNG
幻灯片2.PNG
幻灯片3.PNG
幻灯片4.PNG
885 KB, 下载次数: 27)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
369 KB, 下载次数: 27)
幻灯片1.JPG
幻灯片2.JPG
214 KB, 下载次数: 51)
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
137 KB, 下载次数: 23)
[ 本帖最后由 jack0421 于 2011-8-18 23:58 编辑 ]
[ 本帖最后由 静待花开 于 2011-8-18 13:12 编辑 ]
幻灯片1.JPG
幻灯片2.JPG
幻灯片3.JPG
幻灯片4.JPG
幻灯片5.JPG
幻灯片6.JPG
161 KB, 下载次数: 35)
俺略加修改:将四个过程合并为1个,弄成混合运算,代码如下:
Dim a1 As Integer, a2 As Integer
Dim b1 As Integer, b2 As Integer
Dim c1 As Integer, c2 As Integer
Dim c As Integer, daan As Integer
Dim s1 As String, s2 As String
Sub jiajian()
Randomize
sel:
a1 = Rnd * 8 + 1
a2 = Rnd * 9
b1 = Rnd * 8 + 1
b2 = Rnd * 9
c = 100 * Rnd
a = (-1) ^ c
With ActivePresentation.Slides(1)
If .Shapes("chuti").TextFrame.TextRange.Text = "出 题" Then
.Shapes("sw").TextFrame.TextRange.Text = ""
.Shapes("jw").TextFrame.TextRange.Text = ""
If a = 1 Then
.Shapes("sign").TextFrame.TextRange.Text = "+"
If a1 + b1 < 9 Then
s2 = ""
If a2 + b2 >= 10 Then
s1 = "1"
Else
s1 = ""
End If
Else
GoTo sel
End If
daan = 10 * a1 + a2 + 10 * b1 + b2
c1 = daan \ 10
c2 = daan Mod 10
Else
.Shapes("sign").TextFrame.TextRange.Text = "-"
If a1 > b1 Then
s1 = ""
If a2 < b2 Then
s2 = "·"
Else
s2 = ""
End If
Else
GoTo sel
End If
daan = 10 * a1 + a2 - 10 * b1 - b2
c1 = daan \ 10
c2 = daan Mod 10
If c1 = 0 Then GoTo sel
End If
.Shapes("a1").TextFrame.TextRange.Text = a1
.Shapes("a2").TextFrame.TextRange.Text = a2
.Shapes("b1").TextFrame.TextRange.Text = b1
.Shapes("b2").TextFrame.TextRange.Text = b2
.Shapes("c1").TextFrame.TextRange.Text = ""
.Shapes("c2").TextFrame.TextRange.Text = ""
.Shapes("chuti").TextFrame.TextRange.Text = "看答案"
Else
.Shapes("c1").TextFrame.TextRange.Text = c1
.Shapes("c2").TextFrame.TextRange.Text = c2
.Shapes("jw").TextFrame.TextRange.Text = s1
.Shapes("sw").TextFrame.TextRange.Text = s2
.Shapes("chuti").TextFrame.TextRange.Text = "出 题"
End If
End With
End Sub
[ 本帖最后由 laose 于 2011-8-19 17:06 编辑 ]
14 KB, 下载次数: 29)
谢谢,果果、动感老师。