problem link—http://codeforces.com/problemset/problem/282/A
#include <iostream> #include <string> using namespace std; int main() { int n, x(0); cin >> n; string s; while (n--) { cin >> s; if (s[1] == '+') { ++x; } else { --x; } } cout << x << endl; return 0; }
Estheak
#include
int main()
{
int n,i, x=0;
char s[100];
scanf(“%d”,&n);
for(i=0;i<n;i++)
{
scanf("%s",s);
if (s[1] == '+')
{
x++;
}
else
{
x–;
}
}
printf("%d",x);
return 0;
}
Harun-or-Rashid
ok