當前位置:編程學習大全網 - 源碼下載 - 怎樣用vb算24點

怎樣用vb算24點

設第壹個數為a(0),第二a(1),第三a(2),第四a(3)。

Cls '清空屏幕

Dim b,c,d,e As Integer

For b = 0 To 3

For c = 0 To 3

For d = 0 To 3

For e = 0 To 3

If b<>c And c<>d And d<>e And e<>b And b<>d And c<>e Then

If a(b) + a(c) + a(d) + a(e) = 24 Then ?a(b);"+";a(c);"+";a(d);"+";a(e)

If a(b) + a(c) + a(d) - a(e) = 24 Then ?a(b);"+";a(c);"+";a(d);"-";a(e)

If a(b) + a(c) - a(d) - a(e) = 24 Then ?a(b);"+";a(c);"-";a(d);"-";a(e)

If a(b) - a(c) - a(d) - a(e) = 24 Then ?a(b);"-";a(c);"-";a(d);"-";a(e)

If a(b) * a(c) + a(d) + a(e) = 24 Then ?a(b);"×";a(c);"+";a(d);"+";a(e)

If a(b) * a(c) + a(d) - a(e) = 24 Then ?a(b);"×";a(c);"+";a(d);"-";a(e)

If a(b) * a(c) - a(d) - a(e) = 24 Then ?a(b);"×";a(c);"-";a(d);"-";a(e)

If a(b) * a(c) * a(d) + a(e) = 24 Then ?a(b);"×";a(c);"×";a(d);"+";a(e)

If a(b) * a(c) * a(d) - a(e) = 24 Then ?a(b);"×";a(c);"×";a(d);"-";a(e)

If a(b) * a(c) * a(d) * a(e) = 24 Then ?a(b);"×";a(c);"×";a(d);"×";a(e)

If a(b) / a(c) + a(d) + a(e) = 24 Then ?a(b);"÷";a(c);"+";a(d);"+";a(e)

If a(b) / a(c) + a(d) - a(e) = 24 Then ?a(b);"÷";a(c);"+";a(d);"-";a(e)

If a(b) / a(c) * a(d) + a(e) = 24 Then ?a(b);"÷";a(c);"×";a(d);"+";a(e)

If a(b) / a(c) * a(d) - a(e) = 24 Then ?a(b);"÷";a(c);"×";a(d);"-";a(e)

If a(b) / a(c) / a(d) + a(e) = 24 Then ?a(b);"÷";a(c);"÷";a(d);"+";a(e)

If a(b) / a(c) / a(d) - a(e) = 24 Then ?a(b);"÷";a(c);"÷";a(d);"-";a(e)

If a(b) / a(c) / a(d) * a(e) = 24 Then ?a(b);"÷";a(c);"÷";a(d);"×";a(e)

If a(b) / a(c) / a(d) / a(e) = 24 Then ?a(b);"÷";a(c);"÷";a(d);"÷";a(e)

If a(b) / a(c) + a(d) * a(e) = 24 Then ?a(b);"÷";a(c);"+";a(d);"×";a(e)

If a(b) / a(c) - a(d) * a(e) = 24 Then ?a(b);"÷";a(c);"-";a(d);"×";a(e)

If a(b) / a(c) + a(d) / a(e) = 24 Then ?a(b);"÷";a(c);"+";a(d);"÷";a(e)

If a(b) / a(c) - a(d) / a(e) = 24 Then ?a(b);"÷";a(c);"-";a(d);"÷";a(e)

End If

Next e,d,c,b

可能有問題,請先試試,有問題問我

  • 上一篇:傳統企業怎麽利用網付進行智慧數字化經營?
  • 下一篇:指示器源代碼中的v
  • copyright 2024編程學習大全網