-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBela.java
More file actions
51 lines (44 loc) · 1.54 KB
/
Copy pathBela.java
File metadata and controls
51 lines (44 loc) · 1.54 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
40
41
42
43
44
45
46
47
48
49
50
51
import java.util.Scanner;
public class Bela {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int iterations = sc.nextInt();
String dominate = sc.next();
int total = 0;
for(int i =0; i < iterations;i++)
{
for(int j = 0; j < 4; j++)
{
String temp = sc.next();
if(temp.charAt(0) == 'A')
{
total += 11;
}else if(temp.charAt(0) == 'K')
{
total += 4;
}else if(temp.charAt(0) == 'Q')
{
total += 3;
}else if(temp.charAt(0) == 'T')
{
total += 10;
}else if(temp.charAt(0) == 'J')
{
if(temp.charAt(1) == dominate.charAt(0))
{
total += 20;
}else{
total += 2;
}
}else if(temp.charAt(0) == '9')
{
if(temp.charAt(1) == dominate.charAt(0))
{
total += 14;
}
}
}
}
System.out.println(total);
}
}