-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5622.cpp
More file actions
55 lines (48 loc) · 1002 Bytes
/
5622.cpp
File metadata and controls
55 lines (48 loc) · 1002 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <string>
using namespace std;
int main()
{
int time =0 ;
string word;
cin >> word;
int len = word.length();
for (int i = 0; i < len; i++)
{
if (word[i] == 'A' || word[i] == 'B' || word[i] == 'C')
{
time += 3;
}
else if (word[i] == 'D' || word[i] == 'E' || word[i] == 'F')
{
time += 4;
}
else if (word[i] == 'G' || word[i] == 'H' || word[i] == 'I')
{
time += 5;
}
else if (word[i] == 'J' || word[i] == 'K' || word[i] == 'L')
{
time += 6;
}
else if (word[i] == 'M' || word[i] == 'N' || word[i] == 'O')
{
time += 7;
}
else if (word[i] == 'P' || word[i] == 'Q' || word[i] == 'R' || word[i] == 'S')
{
time += 8;
}
else if (word[i] == 'T' || word[i] == 'U' || word[i] == 'V')
{
time += 9;
}
else if (word[i] == 'W' || word[i] == 'X' || word[i] == 'Y' || word[i] == 'Z')
{
time += 10;
}
else continue;
}
std::cout << time;
return 0;
}