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