/*
    第2種情報処理技術者試験    平成10年度・春期・午後 問11
                                BohYoh Shibata PREPARATION
*/

int CalcScore(char mark[])
{
    static char markCT[] = "0123456789+-";
    int i = 0, score = 0, s0, s1, s2;

    while(mark[i] != '\0') {
        for (s0 = 0; mark[i] != markCT[s0]; s0++);
        if (s0 <= 9) {
            score += s0;
        } else if (s0 == 10) {
            for (s1 = 0; mark[i + 1] != markCT[s1]; s1++);
            score += 10 + s1;
        } else {
            for (s2 = 0; mark[i - 1] != markCT[s2]; s2++);
            score += 10 + s2;
        }
        i++;
    }
    return score;
}