#include<iostream>
using namespace std;
char st[1000];

 

int main()
{
    while(cin.getline(st,990) && st[0]!='#')
    {
        int len=strlen(st);
        int i;
        long sum=0;
        for(i=0;i<len;i++)
            if(st[i]!=' ')
                sum+=(st[i]-'A'+1)*(i+1);

        cout<<sum<<endl;
    }


    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-03-03
猜你喜欢
  • 2022-12-23
  • 2021-10-21
  • 2021-09-21
  • 2022-01-12
  • 2022-02-11
  • 2021-11-15
  • 2021-12-12
相关资源
相似解决方案