-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberFun.java
More file actions
26 lines (23 loc) · 807 Bytes
/
Copy pathNumberFun.java
File metadata and controls
26 lines (23 loc) · 807 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 NumberFun {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int total = sc.nextInt();
for (int i = 1; i <= total; i++) {
float a = sc.nextFloat();
float b = sc.nextFloat();
float c = sc.nextFloat();
if (c == a + b) {
System.out.println("Possible");
} else if ((c == a - b) || (c == b - a)) {
System.out.println("Possible");
} else if (c == a * b) {
System.out.println("Possible");
} else if ((c == a / b) || (c == b / a)) {
System.out.println("Possible");
} else {
System.out.println("Impossible");
}
}
}
}