-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnton.java
More file actions
30 lines (30 loc) · 813 Bytes
/
Anton.java
File metadata and controls
30 lines (30 loc) · 813 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
import java.util.*;
public class Anton {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
String str[]=new String[n];
for(int i=0;i<n;i++){
str[i]=sc.next();
}
int sum=0;
for(int i=0;i<n;i++){
if(str[i].equals("Tetrahedron")){
sum=sum+4;
}
else if(str[i].equals("Cube")){
sum=sum+6;
}
else if(str[i].equals("Octahedron")){
sum=sum+8;
}
else if(str[i].equals("Dodecahedron")){
sum=sum+12;
}
else if(str[i].equals("Icosahedron")){
sum=sum+20;
}
}
System.out.println(sum);
}
}