poj3094
#include<stdio.h> #include<string.h> int main() { int i,sum,temp; char ch[260]; while(1) { //scanf("%s",ch); gets(ch); if(strcmp(ch,"#")==0) break; sum=0; temp=1; for(i=0;i<strlen(ch);i++) { if(ch[i]>='A'&&ch[i]<='Z') sum+=(ch[i]-'A'+1)*temp; temp++; } printf("%d\n",sum); } return 0; }
挺简单的
keep moving...