-
Notifications
You must be signed in to change notification settings - Fork 0
/
MinOfThree.java
37 lines (32 loc) · 988 Bytes
/
MinOfThree.java
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
import java.util.*;
public class MinOfThree {
public static void main(String[] argv) {
Scanner sc = new Scanner(System.in);
int newCase = sc.nextInt();
for(int i = 0; i < newCase; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a < b) {
if (a < c) {
System.out.println(a);
System.out.println(" ");
}
else {
System.out.println(c);
System.out.println(" ");
}
}
else {
if (b < c) {
System.out.println(b);
System.out.println(" ");
}
else {
System.out.println(c);
System.out.println(" ");
}
}
}
}
}