The previous algorithm used to drag the winning algorithm from the Eleventh Five-Year shopping spree was the second, second, third, and third .... in addition, the algorithm is written a long time later. The main reason is that he calculates the amount of attention each note to determine whether to win the prize. This algorithm is used to calculate whether to win the prize first and then based on the winning situation (number in the Code and in the drag-and-drop code ). count to calculate the total number of winning bets) and drag all the code to use this algorithm. // The code is incomplete.
Package com. sscgameservice. manager. lottery. renxuan. dantuo; import java. math. bigDecimal; import com. sscgameservice. manager. lottery. lottery; import com. sscgameservice. model. lotteryBean; public class RXDTBASELottery extends Lottery {/*** optional bold drag */private int q; // Number of two q values h Two q = 2 h = 2 private int h; public void setQ (int q) {this. q = q;} public void setH (int h) {this. h = h ;}// calculate the number of winning bets <span style = "font -Family: Arial, Helvetica, sans-serif "> strBuy is a symbolic link between the lottery numbers </span> private BigDecimal jisuanZhuShu (String [] danMa, String [] tuoMa, string strBuy) {int FlagDM = 0; int FlagTM = 0; for (String string: tuoMa) {if (strBuy. indexOf (string. replace ("",""))! =-1) {FlagTM ++ ;}for (String string: danMa) {if (strBuy. indexOf (string. replace ("",""))! =-1) {FlagDM ++ ;}// if (FlagDM + FlagTM >=h & FlagTM >=1 & FlagDM >=1 & danMa. length-FlagDM <= q-h) {// winning int zhushu = 1; if (h! = 5) {for (int I = FlagTM; I> 1; I --) {zhushu * = I;} for (int I = FlagTM-(h-FlagDM ); i> 1; I --) {zhushu/= I;} for (int I = h-FlagDM; I> 1; I --) {zhushu/= I ;}} return new BigDecimal (zhushu); // Number of winning tickets} else {// No winning} return new BigDecimal ("0 ");}}