private static void CHSM(int tip, int count, Boolean isGift, String msg) {
int singleCost = 0;
int maxCost = 0;
int total = 0;
int countBaiPiao = 0;
int countHThousand = 0;
int countThousand = 0;
java.util.Map<Integer,Integer> realBollMap = new java.util.HashMap<Integer,Integer>();
if (isGift) {
realBollMap = CHGiftMap;
} else {
realBollMap = CHSMMap;
}
for (int i = 0;i < count; i++) {
singleCost = returnCHSMCost(tip, realBollMap);
if (singleCost > maxCost) {
maxCost = singleCost;
}
if (singleCost > 500) {
countHThousand++;
}
if (singleCost > 1000) {
countThousand++;
}
if (singleCost == 0) {
countBaiPiao++;
}
total += singleCost;
}
System.out.println(msg + "幼儿园策划们送的猫爪数" + tip + "\n取样" + ((float)count/10000) + "万条数据,平均花费:" + ((float)total/count) + " 非洲酋长花费:" +
+ maxCost + " 白嫖选手占比:" + ((float)countBaiPiao*100/count) + "%\n 亚洲花500以上的选手占比:" + ((float)countHThousand*100/count) + "% "
+ " 悲催的1000以上选手(没错就是我)占比:" + ((float)countThousand*100/count) + "%,人数" + countThousand +"\n");
}
public static void main(String[] args) {
CHSM(20, 2000000, false, "统计一开始所谓大数据期望的情况:\n");
CHSM(28, 2000000, true, "搞事之后补偿的期望:\n");
CHSM(2, 2000000, false, "大佬们第一天出来就全都要的情况:\n");
CHSM(10, 2000000, true, "搞事之后补偿第一天就全都要的情况:\n");
}