karlangadas

Bit++ cf

Dec 27th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <string>
  4. #include <cstring>
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n,ans=0;
  9.     string s;
  10.     cin>>n;
  11.     while(n--){
  12.         cin>>s;
  13.         if (s[0]==s[1]){
  14.             if (s[0]=='+')
  15.                 ans++;
  16.             else
  17.                 ans--;
  18.         }
  19.         else{
  20.             if (s[1]=='+')
  21.                 ans++;
  22.             else
  23.                 ans--;
  24.            
  25.         }
  26.     }
  27.     cout<<ans<<endl;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment