/*
Time:2019.11.29
Author: Goven
type:string模拟
err:
ref:
*/
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
int l, quickSum;
while (getline(cin, s) && s != "#") {
l = s.length();
quickSum = 0;
for (int i = 0; i < l; i++) {
if (s[i] == ' ') continue;
quickSum += (s[i] - 'A' + 1) * (i + 1);
}
cout << quickSum << endl;
}
return 0;
}
网友评论