-
Notifications
You must be signed in to change notification settings - Fork 0
/
10260.cpp
56 lines (51 loc) · 1.1 KB
/
10260.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
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
56
#include <cstdio>
#include <cstring>
using namespace std;
int main(void)
{
char sen[21];
int i, cur, pre;
while (scanf("%s", sen) != EOF) {
pre = 0;
for (i = 0; i < strlen(sen); ++i) {
switch (sen[i]) {
case 'B':
case 'F':
case 'P':
case 'V':
cur = 1;
break;
case 'C':
case 'G':
case 'J':
case 'K':
case 'Q':
case 'S':
case 'X':
case 'Z':
cur = 2;
break;
case 'D':
case 'T':
cur = 3;
break;
case 'L':
cur = 4;
break;
case 'M':
case 'N':
cur = 5;
break;
case 'R':
cur = 6;
break;
default:
cur = 0;
}
if (cur > 0 && cur != pre) printf("%d", cur);
pre = cur;
}
printf("\n");
}
return 0;
}