好吧可能帮不到你 第一,x可能不在集合里 我眼瞎没看见,标黑了 在操作1的判断语句里加入防黑代码如下:
auto tot = s1.find(x); if(tot == s1.end()) { return 0; }
就可以啦~