-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheje2300.java
More file actions
39 lines (38 loc) · 1.16 KB
/
eje2300.java
File metadata and controls
39 lines (38 loc) · 1.16 KB
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
import java.util.Scanner;
public class eje2300
{
public static void main(String [] args){
Scanner lee = new Scanner(System.in);
String p = lee.nextLine();
int cont = 0;
for(int i=0;i<p.length();i++){
switch(p.charAt(i)){
case 'A': case 'B': case 'C':
cont +=3;
break;
case 'D': case 'E': case 'F':
cont +=4;
break;
case 'G': case 'H': case 'I':
cont +=5;
break;
case 'J': case 'K': case 'L':
cont +=6;
break;
case 'M': case 'N': case 'O':
cont +=7;
break;
case 'P': case 'Q': case 'R': case 'S':
cont += 8;
break;
case 'T': case 'U': case 'V':
cont +=9;
break;
case 'W': case 'X': case 'Y': case 'Z':
cont +=10;
break;
}
}
System.out.println(cont);
}
}