Solution in c++
#include<bits/stdc++.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int n, x(0);
cin >> n;
string s;
while (n--) {
cin >> s;
if (s[1] == '+') {
++x;
}
else
{
--x;
}
}
cout << x << endl;
return 0;
}
0 Comments
If you have any doubts, Please let me know