1、其实只要判断中间那个字符是'+'还是'-'就行了
class Solution {
public:
int finalValueAfterOperations(vector<string>& operations) {
int sum=0;
int thesize=operations.size();
for(int i=0;i<thesize;++i)
{
if(operations[i][1]=='+') ++sum;
else --sum;
}
return sum;
}
};