Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
366 B
6
Indexable
Never
int scoremath(string words)
{
    int score = 0;
    int i;
    int len;

    for (i = 0, len = strlen(words); i < len; i++)
    {
        if(isupper(words[i]))
        {
            score += POINTS[words[i] - 'A'];
        }
        else if(islower(words[i]))
            {
                score += POINTS[words[i] - 'a'];
            }

    }

    return score;

}
Leave a Comment