Untitled
unknown
plain_text
2 years ago
366 B
15
Indexable
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;
}Editor is loading...
Leave a Comment