Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int i, n, j, count=0;
- string s;
- cin>>n;
- getline(cin,s);
- for (i=0; i<n; i++) {
- getline(cin,s);
- if (s[0] == '+' || s[1] == '+' || s[3] == '+') count++;
- if (s[0] == '-' || s[1] == '-' || s[3] == '-') count--;
- }
- cout<<count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement