topcoder SRM 618 DIV2 WritingWords

只需要对word遍历一遍即可

    int write(string word) {
        int cnt = 0;
        for(int i = 0 ; i < word.length(); ++ i){
            cnt+=word[i]-'A'+1;
        }
        return cnt;
    }

 

posted @ 2014-06-16 20:01  OpenSoucre  阅读(132)  评论(0编辑  收藏  举报