thanks
#includeint main(){ int n,x=0; char c[100],a[4]="X++",b[4]="++X"; scanf("%d",&n); while(n--) { getchar(); gets(c); if(strcmp(c,a)==0 || strcmp(c,b)==0) { x++; } else x--; } printf("%d\n",x); return 0;}
thanks
ReplyDelete#include
ReplyDeleteint main()
{
int n,x=0;
char c[100],a[4]="X++",b[4]="++X";
scanf("%d",&n);
while(n--)
{
getchar();
gets(c);
if(strcmp(c,a)==0 || strcmp(c,b)==0)
{
x++;
}
else
x--;
}
printf("%d\n",x);
return 0;
}