怎么让13 350 40 18这四个数字通过运算最后结果等于他们其中任何1个数字呢?正确的我多给300分其实。40 18 是我和女朋友的学号,350,是我与她出生时间的相差分,13是我与她出生日期的相差13

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/04 03:26:07
怎么让133504018这四个数字通过运算最后结果等于他们其中任何1个数字呢?正确的我多给300分其实。4018是我和女朋友的学号,350,是我与她出生时间的相差分,13是我与她出生日期的相差13怎么

怎么让13 350 40 18这四个数字通过运算最后结果等于他们其中任何1个数字呢?正确的我多给300分其实。40 18 是我和女朋友的学号,350,是我与她出生时间的相差分,13是我与她出生日期的相差13
怎么让13 350 40 18这四个数字通过运算最后结果等于他们其中任何1个数字呢?正确的我多给300分
其实。40 18 是我和女朋友的学号,350,是我与她出生时间的相差分,13是我与她出生日期的相差13日。我就想看看有缘么

怎么让13 350 40 18这四个数字通过运算最后结果等于他们其中任何1个数字呢?正确的我多给300分其实。40 18 是我和女朋友的学号,350,是我与她出生时间的相差分,13是我与她出生日期的相差13
小伙我给个权威的答案好了,不过你害得我好苦呀(我还以认我的程序出错了,没看你的补充还以为一定有一个答案的)
实验证明,这几个达不到你说的结果,无论怎么算都有不可能,我穷尽了所有
排列,组合,
但这与看看有缘么没多大关系吧,祝你们幸福.
证明过程如下:可以测试下(任意四个数,指定结果,列出所有组合,比如算24):
Dim a(4) As Integer
Dim Result As Integer
Private Sub Command1_Click()
Text2 = ""
Result = Val(Text3.Text)
For z = 0 To 3
a(z + 1) = Val(Text1(z))
Next z
For i = 1 To 4
For j = 1 To 4
If i j Then
For nb1 = 1 To 4
X1 = f(a(i), a(j), nb1)
For k = 1 To 4
If (k i) And (k j) Then
For nb2 = 1 To 4
X2 = f(X1, a(k), nb2)
For l = 1 To 4
If (l i) And (l j) And (l k) Then
For nb3 = 1 To 4
x3 = f(X2, a(l), nb3)
If x3 = Result Then



Select Case nb1
Case 1: sb1 = "+"
Case 2: sb1 = "-"
Case 3: sb1 = "*"
Case 4: sb1 = "/"
End Select


Select Case nb2
Case 1: sb2 = "+"
Case 2: sb2 = "-"
Case 3: sb2 = "*"
Case 4: sb2 = "/"
End Select

Select Case nb3
Case 1: sb3 = "+"
Case 2: sb3 = "-"
Case 3: sb3 = "*"
Case 4: sb3 = "/"
End Select

Text2 = Text2 & "(" & "(" & a(i) & sb1 & a(j) & ")" & sb2 & a(k) & ")" & sb3 & a(l) & Chr(10) & " "

End If



Next nb3
End If
Next l
Next nb2
End If
Next k
Next nb1
End If
Next j
Next i
i = 0
j = 0
k = 0
l = 0
nb1 = 0
nb2 = 0
nb3 = 0
X1 = 0
X2 = 0
x3 = 0
For i = 1 To 4
For j = 1 To 4
If i j Then
For nb1 = 1 To 4
X1 = f(a(i), a(j), nb1)
For k = 1 To 4
If (k i) And (k j) Then
For nb2 = 1 To 4
X2 = f(X1, a(k), nb2)
For l = 1 To 4
If (l i) And (l j) And (l k) Then
For nb3 = 1 To 4
x3 = f(a(l), X2, nb3)
If x3 = Result Then



Select Case nb1
Case 1: sb1 = "+"
Case 2: sb1 = "-"
Case 3: sb1 = "*"
Case 4: sb1 = "/"
End Select


Select Case nb2
Case 1: sb2 = "+"
Case 2: sb2 = "-"
Case 3: sb2 = "*"
Case 4: sb2 = "/"
End Select

Select Case nb3
Case 1: sb3 = "+"
Case 2: sb3 = "-"
Case 3: sb3 = "*"
Case 4: sb3 = "/"
End Select

Text2 = Text2 & a(l) & sb3 & "(" & a(k) & sb2 & "(" & a(i) & sb1 & a(j) & ")" & ")" & " "

End If



Next nb3
End If
Next l
Next nb2
End If
Next k
Next nb1
End If
Next j
Next i
i = 0
j = 0
k = 0
l = 0
nb1 = 0
nb2 = 0
nb3 = 0
X1 = 0
X2 = 0
x3 = 0
For i = 1 To 4
For j = 1 To 4
If i j Then
For nb1 = 1 To 4
X1 = f(a(i), a(j), nb1)
For k = 1 To 4
If (k i) And (k j) Then
For l = 1 To 4
If (l i) And (l j) And (l k) Then
For nb2 = 1 To 4
X2 = f(a(k), a(l), nb2)
For nb3 = 1 To 4

x3 = f(X2, X1, nb3)
If x3 = Result Then



Select Case nb1
Case 1: sb1 = "+"
Case 2: sb1 = "-"
Case 3: sb1 = "*"
Case 4: sb1 = "/"
End Select


Select Case nb2
Case 1: sb2 = "+"
Case 2: sb2 = "-"
Case 3: sb2 = "*"
Case 4: sb2 = "/"
End Select

Select Case nb3
Case 1: sb3 = "+"
Case 2: sb3 = "-"
Case 3: sb3 = "*"
Case 4: sb3 = "/"
End Select

Text2 = Text2 & "(" & a(k) & sb2 & a(l) & ")" & sb3 & "(" & a(i) & sb1 & a(j) & ")" & " "

End If



Next nb3


Next nb2
End If
Next l
End If
Next k
Next nb1
End If
Next j
Next i
i = 0
j = 0
k = 0
l = 0
nb1 = 0
nb2 = 0
nb3 = 0
X1 = 0
X2 = 0
x3 = 0
For i = 1 To 4
For j = 1 To 4
If i j Then
For nb1 = 1 To 4
X1 = f(a(i), a(j), nb1)
For k = 1 To 4
If (k i) And (k j) Then
For nb2 = 1 To 4
X2 = f(a(k), X1, nb2)
For l = 1 To 4
If (l i) And (l j) And (l k) Then
For nb3 = 1 To 4
x3 = f(X2, a(l), nb3)
If x3 = Result Then



Select Case nb1
Case 1: sb1 = "+"
Case 2: sb1 = "-"
Case 3: sb1 = "*"
Case 4: sb1 = "/"
End Select


Select Case nb2
Case 1: sb2 = "+"
Case 2: sb2 = "-"
Case 3: sb2 = "*"
Case 4: sb2 = "/"
End Select

Select Case nb3
Case 1: sb3 = "+"
Case 2: sb3 = "-"
Case 3: sb3 = "*"
Case 4: sb3 = "/"
End Select

Text2 = Text2 & "(" & a(k) & sb2 & "(" & a(i) & sb1 & a(j) & ")" & ")" & sb3 & a(l) & " "

End If



Next nb3
End If
Next l
Next nb2
End If
Next k
Next nb1
End If
Next j
Next i
i = 0
j = 0
k = 0
l = 0
nb1 = 0
nb2 = 0
nb3 = 0
X1 = 0
X2 = 0
x3 = 0
For i = 1 To 4
For j = 1 To 4
If i j Then
For nb1 = 1 To 4
X1 = f(a(i), a(j), nb1)
For k = 1 To 4
If (k i) And (k j) Then
For nb2 = 1 To 4
X2 = f(a(k), X1, nb2)
For l = 1 To 4
If (l i) And (l j) And (l k) Then
For nb3 = 1 To 4
x3 = f(a(l), X2, nb3)
If x3 = Result Then



Select Case nb1
Case 1: sb1 = "+"
Case 2: sb1 = "-"
Case 3: sb1 = "*"
Case 4: sb1 = "/"
End Select


Select Case nb2
Case 1: sb2 = "+"
Case 2: sb2 = "-"
Case 3: sb2 = "*"
Case 4: sb2 = "/"
End Select

Select Case nb3
Case 1: sb3 = "+"
Case 2: sb3 = "-"
Case 3: sb3 = "*"
Case 4: sb3 = "/"
End Select

Text2 = Text2 & a(l) & sb3 & "(" & a(k) & sb2 & "(" & a(i) & sb1 & a(j) & ")" & ")" & " "

End If



Next nb3
End If
Next l
Next nb2
End If
Next k
Next nb1
End If
Next j
Next i
i = 0
j = 0
k = 0
l = 0
nb1 = 0
nb2 = 0
nb3 = 0
X1 = 0
X2 = 0
x3 = 0

End Sub
Private Sub Form_Load()
For i = 0 To 3
Text1(i) = ""
Next i
Text2 = ""
End Sub
Private Function f(a, b, number)
If b 0 Then
Select Case number
Case 1: f = a + b
Case 2: f = a - b
Case 3: f = a * b
Case 4: f = a / b
End Select
Else
Select Case number
Case 1: f = a + b
Case 2: f = a - b
Case 3: f = a * b
Case 4: f = 99999
End Select
End If
End Function

每个数字可以用几次?很多次只要你最后结果是其中1个数((40-18)+(18-13))/(40-13)*350=350你能不能一步步说下,头晕。。啊?这个简单的加减乘除还要解释? 不过作为题目,我也觉得只能用一次,能随便用就没意义了,总可以凑出来你这个最后结果是350么?你再验算下...

全部展开

每个数字可以用几次?

收起

(350/350) * 350 = 350.....显然不能用多次。

这是几年级的题啊,没什么意义。
每个数字能用几次?没有更多的条件限制的话什么数都可以得到啊!!!
13/13=1
13/13+13/13+......就可以得到任何数了啊
你确定没别的条件了么?
除号打不出来 13/13就表示 13除以13偶说啊。。。。是这4个数之间加减乘除。最后的结果是4个数中的1个数啊。。。...

全部展开

这是几年级的题啊,没什么意义。
每个数字能用几次?没有更多的条件限制的话什么数都可以得到啊!!!
13/13=1
13/13+13/13+......就可以得到任何数了啊
你确定没别的条件了么?
除号打不出来 13/13就表示 13除以13

收起

是加减乘除吗?