Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a,i,x=0;
- scanf("%d",&a);
- for(i=0;i<a;i++)
- {
- char str[4];
- scanf("%s",str);
- if(str[0]=='+'&&str[1]=='+'&&str[2]=='X')
- {
- x++;
- }
- else if(str[0]=='X'&&str[1]=='+'&&str[2]=='+')
- {
- x++;
- }
- else if(str[0]=='-'&&str[1]=='-'&&str[2]=='X')
- {
- x--;
- }
- else if(str[0]=='X'&&str[1]=='-'&&str[2]=='-')
- {
- x--;
- }
- }
- printf("%d\n",x);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement