-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMishka.java
More file actions
26 lines (25 loc) · 740 Bytes
/
Mishka.java
File metadata and controls
26 lines (25 loc) · 740 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
import java.util.Scanner;
public class Mishka {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int mishkaWins = 0;
int chrisWins = 0;
for (int i = 0; i < n; i++) {
int m = sc.nextInt();
int c = sc.nextInt();
if (m > c) {
mishkaWins++;
} else if (c > m) {
chrisWins++;
}
}
if (mishkaWins > chrisWins) {
System.out.println("Mishka");
} else if (chrisWins > mishkaWins) {
System.out.println("Chris");
} else {
System.out.println("Friendship is magic!^^");
}
}
}