-
Notifications
You must be signed in to change notification settings - Fork 0
/
5622.cpp
29 lines (29 loc) · 837 Bytes
/
5622.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
string str;
int second = 0;
cin >> str;
for (int i = 0; i < str.length(); i++)
{
if (str.at(i) >= 'A' && str.at(i) <= 'C')
second += 3;
else if (str.at(i) >= 'D' && str.at(i) <= 'F')
second += 4;
else if (str.at(i) >= 'G' && str.at(i) <= 'I')
second += 5;
else if (str.at(i) >= 'J' && str.at(i) <= 'L')
second += 6;
else if (str.at(i) >= 'M' && str.at(i) <= 'O')
second += 7;
else if (str.at(i) >= 'P' && str.at(i) <= 'S')
second += 8;
else if (str.at(i) >= 'T' && str.at(i) <= 'V')
second += 9;
else if (str.at(i) >= 'W' && str.at(i) <= 'Z')
second += 10;
}
cout << second;
}