假设 vr 是一个 string 类型的 vector 数组,
string_int(string s) 返回将 s 转为数字的结果,rt
while (!vr.empty()) {
auto times = find(vr.begin(), vr.end(), "*");
if (times != vr.end()) {
int index = times - vr.begin();
cout << vr[index] << endl;
int a = string_int(vr[index - 1]);
int b = string_int(vr[index + 1]);
vr.erase(vr.begin() + index - 1, vr.begin() + index + 2);
vr.insert(vr.begin() + index - 1, a * b);
for (auto i : vr) {
cout << i << ' ';
}
break;
}
}