标签:
#include <stdio.h> #include <string.h> char word[301]; int main() { int sum = 0; int i,len; while(gets(word)) { sum = 0; if(word[0] == ‘#‘) break; len = strlen(word); for(i = 0; i < len; ++i) { if(word[i] != ‘ ‘) sum += (i+1) * (word[i]-‘A‘+1); } printf("%d\n",sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/guoyongheng/p/5722513.html