C++代码 //模仿stack 先进后出 void Push(std::vector<int>& vect, int num) { if (vect.empty()) { vect.push_back(num); return; } int end = vect[vect.size() - 1]; if (end == num) { vect.erase(std::next(vect.end(),-1)); Push(vect, num * 2); } ...