Advertisement
Radoan_Ahmed

Untitled

Aug 10th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int a,i,x=0;
  5.     scanf("%d",&a);
  6.     for(i=0;i<a;i++)
  7.     {
  8.         char str[4];
  9.         scanf("%s",str);
  10.         if(str[0]=='+'&&str[1]=='+'&&str[2]=='X')
  11.         {
  12.             x++;
  13.         }
  14.         else if(str[0]=='X'&&str[1]=='+'&&str[2]=='+')
  15.         {
  16.             x++;
  17.         }
  18.         else if(str[0]=='-'&&str[1]=='-'&&str[2]=='X')
  19.         {
  20.             x--;
  21.         }
  22.         else if(str[0]=='X'&&str[1]=='-'&&str[2]=='-')
  23.         {
  24.             x--;
  25.         }
  26.     }
  27.     printf("%d\n",x);
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement