MrTheDzam

Xác Suất

Apr 9th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.45 KB | None | 0 0
  1. Func XacSuat($so1, $tile_so1, $so2, $tile_so2)
  2.     If $tile_so1 + $tile_so2 = 100 then
  3.         If $tile_so1 > $tile_so2 then
  4.             Return $so1
  5.         ElseIf $tile_so2 > $tile_so1 then
  6.             Return $so2
  7.         Else
  8.             If $so1 > $so2 then
  9.                 Return Random($so2, $so1, 1)
  10.             Else
  11.                 Return Random($so1, $so2, 1)
  12.             EndIf
  13.         EndIf
  14.     Else
  15.         MsgBox(64, "Message", "Tỉ lệ cộng lại phải bằng 100%")
  16.     EndIf
  17. EndFunc
  18.  
  19. MsgBox(64, "Message", XacSuat(1, 50, 2, 50))
Advertisement
Add Comment
Please, Sign In to add comment