#include <iostream>
#include <string>
using namespace std;
int main(){
for(string str;getline(cin,str)&&str!="#";){
int crc=0;
for(int i=0;i<str.length();++i){
char c=str[i];
if(c<='Z'&&c>='A')
crc+=(i+1)*(c-'A'+1);
}
cout<<crc<<endl;
}
return 0;
}
Saturday, 21 March 2009
POJ ( acm.pku.edu.cn ) 3094
我爱水题我爱水题
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment