public class Practice3 {
public static void main(String[] args) { /** * N = x[0]+x[1]+x[2]+(y[0]+y[1]+y[2])/2 * 假設每一個玩家有5個筹马,每局胜负為1. */
double[] res = new double[3];
double sumRate = 0.0;
double[] originRate = new double[] {0.57,0.45,0.47};
int[] money = new int[] {5,5,5}; t2(1000000,originRate,money);
}
public static double[] t2(int N, double[] p, int[] money) {
double[] res = new double[3];
for(int i = 0; i < 3; i++) {
res = 4 * (2 * p - 1) / 3 - 0.2;
}
for(int i = 0; i < 3; i++) {
if (res >= 0) System.out.println(i + "号赢,均匀每局" + res);
else {
int temp = (int)(-money / res);
System.out.println(i + "号输,均匀输光局数:" + temp);
}
}
return res;
}
}