Wednesday, March 19, 2014

Codeforces Round #173 (Div. 2), problem: (A) Bit++ solution

Codeforces Round #173 (Div. 2), problem: (A) Bit++: http://codeforces.com/problemset/problem/282/A

Codeforces Round #173 (Div. 2), problem: (A) Bit++ solution: http://ideone.com/U6SD1p

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
    int n, r;
    char s[5];
    r=0;
    scanf("%d", &n);
    while(n--) {
        scanf("%s", s);
        if(s[0]=='+' || s[1]=='+') r++;
        else r--;
    }
    printf("%d", r);
    return 0;
}

No comments:

Post a Comment