6个回答
展开全部
Option Explicit
Private Sub Command1_Click()
Dim i%, j%, k%, l%, a, Text$, y#
Dim dic As Object, dic1 As Object
Set dic = CreateObject("Scripting.Dictionary")
Set dic1 = CreateObject("Scripting.Dictionary")
ScriptControl1.Language = "VBScript"
a = Array(6, 8, 3, 2, 7)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic.Exists(y) Then
dic(y) = dic.Item(y) & "=" & Text
Else
dic(y) = Text
End If
Next l, k, j, i
a = Array(7, 3, 5, 4, 2)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic.Exists(y) Then
dic1(y) = dic.Item(y) & "=" & Text
dic(y) = dic.Item(y) & "=" & Text
End If
Next l, k, j, i
dic.removeall
a = Array(9, 4, 3, 6, 1)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic1.Exists(y) Then
dic1(y) = dic1.Item(y) & "=" & Text
dic(y) = dic1.Item(y)
Text1.Text = Text1.Text & vbCrLf & y & "=" & dic.Item(y)
End If
Next l, k, j, i
End Sub
Private Sub Command1_Click()
Dim i%, j%, k%, l%, a, Text$, y#
Dim dic As Object, dic1 As Object
Set dic = CreateObject("Scripting.Dictionary")
Set dic1 = CreateObject("Scripting.Dictionary")
ScriptControl1.Language = "VBScript"
a = Array(6, 8, 3, 2, 7)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic.Exists(y) Then
dic(y) = dic.Item(y) & "=" & Text
Else
dic(y) = Text
End If
Next l, k, j, i
a = Array(7, 3, 5, 4, 2)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic.Exists(y) Then
dic1(y) = dic.Item(y) & "=" & Text
dic(y) = dic.Item(y) & "=" & Text
End If
Next l, k, j, i
dic.removeall
a = Array(9, 4, 3, 6, 1)
For i = 1 To 4
For j = 1 To 4
For k = 1 To 4
For l = 1 To 4
Text = a(0) & Mid("+-*/", i, 1) & a(1) _
& Mid("+-*/", j, 1) & a(2) _
& Mid("+-*/", k, 1) & a(3) _
& Mid("+-*/", l, 1) & a(4)
y = ScriptControl1.Eval(Text)
If dic1.Exists(y) Then
dic1(y) = dic1.Item(y) & "=" & Text
dic(y) = dic1.Item(y)
Text1.Text = Text1.Text & vbCrLf & y & "=" & dic.Item(y)
End If
Next l, k, j, i
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个简单吧,把三组表达式的所有可能结果都计算出来,然后看三组里面哪个是重复的,就算出来了呗
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
6(×)8(÷)3(-)2(-)7=7(-)3(×)5(÷)4(-)2=9(×)4(÷)3(-)6(+)1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
6(×)8(÷)3(-)2(-)7=7(-)3(×)5(÷)4(-)2=9(×)4(÷)3(-)6(+)1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询