Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int i, n, j, count=0;
  7. string s;
  8. cin>>n;
  9. getline(cin,s);
  10. for (i=0; i<n; i++) {
  11. getline(cin,s);
  12. if (s[0] == '+' || s[1] == '+' || s[3] == '+') count++;
  13. if (s[0] == '-' || s[1] == '-' || s[3] == '-') count--;
  14. }
  15. cout<<count;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement