You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
ios::sync_with_stdio(false); //读入输出优化的强迫症
|
|
|
|
|
map<char, int> _map;//表示以char类型为下标,存储的是int
|
|
|
|
|
_map['a'] = 1;
|
|
|
|
|
_map['b'] = 2;
|
|
|
|
|
_map['c'] = 3;
|
|
|
|
|
_map['d'] = 1;
|
|
|
|
|
_map['e'] = 2;
|
|
|
|
|
_map['f'] = 3;
|
|
|
|
|
_map['g'] = 1;
|
|
|
|
|
_map['h'] = 2;
|
|
|
|
|
_map['i'] = 3;
|
|
|
|
|
_map['j'] = 1;
|
|
|
|
|
_map['k'] = 2;
|
|
|
|
|
_map['l'] = 3;
|
|
|
|
|
_map['m'] = 1;
|
|
|
|
|
_map['n'] = 2;
|
|
|
|
|
_map['o'] = 3;
|
|
|
|
|
_map['p'] = 1;
|
|
|
|
|
_map['q'] = 2;
|
|
|
|
|
_map['r'] = 3;
|
|
|
|
|
_map['s'] = 4;
|
|
|
|
|
_map['t'] = 1;
|
|
|
|
|
_map['u'] = 2;
|
|
|
|
|
_map['v'] = 3;
|
|
|
|
|
_map['w'] = 1;
|
|
|
|
|
_map['x'] = 2;
|
|
|
|
|
_map['y'] = 3;
|
|
|
|
|
_map['z'] = 4;
|
|
|
|
|
_map[' '] = 1;
|
|
|
|
|
string str = "";
|
|
|
|
|
//输入一个字符串
|
|
|
|
|
getline(cin, str);
|
|
|
|
|
|
|
|
|
|
int l = 0;
|
|
|
|
|
for (int i = 0; i < str.length(); i++) {
|
|
|
|
|
l += _map[str[i]];
|
|
|
|
|
}
|
|
|
|
|
cout << l << endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|