#include<iostream>#include<ctime>#include<cstdlib>#include<fstream>#define count 10000#define healthy 100000#define base_damage 10#define a_win 0#define b_win 1#define a_first 0#define b_first 1inta_first_winner();//a先手时的赢家intb_first_winner();//b先手时的赢家doubleAToBdam(void);//a对b的伤害,a为暴击率99%,爆伤1%;doubleBToAdam(void);//b对a的伤害,b为暴击率1%,爆伤99%;intmain(void){inti=0;intaw=0;intbw=0;inta_f=0;intb_f=0;std::ofstreamout;out.open("log.txt");for(intn=0;n<10;n++){i=0;aw=0;bw=0;srand(time(NULL));for(;i<count;i++){if((rand()%2)==a_first)//a先手{if(a_first_winner()==a_win){aw++;}elsebw++;}else//b先手{if(b_first_winner()==a_win){aw++;}elsebw++;}}//std::cout << "a win:" << aw << " b win:" << bw << std::endl;//std::cout << "******************************" << std::endl;out<<"a win:"<<aw<<" b win:"<<bw<<std::endl;out<<"******************************"<<std::endl;}return0;}inta_first_winner(){doublea=hea