一道小学题,让数学大神三天三夜没睡着觉

class Peach{
public:
int count = 0;
int total = 0;
int nucleus = 0;
int money = 100;
void BuyPeach(){
money--; count++;
}
void Eat(){
count--; nucleus++; total++;
}
void Exchange(){
count += nucleus/2;
nucleus -= nucleus/2*2;
}
void PrintArrtibute(){
cout << "total is " << total << endl;
cout << "money is " << money << endl;
cout << "nucleus is " << nucleus << endl;
cout << "count is " << count << endl;
}
};
void TotalPeach(){
Peach P;
while(P.money>0){
P.BuyPeach();
}
while(P.count>0{
P.Eat();
if(P.nucleus>=2)P.Exchange();
}
P.PrintArrtibute();}
int main() {
TotalPeach();
return 0;
}