-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumber.java
More file actions
35 lines (27 loc) · 938 Bytes
/
Copy pathnumber.java
File metadata and controls
35 lines (27 loc) · 938 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
31
32
33
34
35
//TEST
import java.util.Scanner;
public class number {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
String[] output = new String[n];
for (int i = 0; i < n; i++) {
String input= sc.nextLine();
String[] in = input.split("\\s+");
int a = Integer.parseInt(in[0]);
int b = Integer.parseInt(in[1]);
int c = Integer.parseInt(in[2]);
if(((a+b)==c)||((a*b)==c)||((a-b)==c)||((b-a)==c)||(((double)a/(double)b)==(double)c)||(((double)b/(double)a)==(double)c)){
output[i] = "Possible";
}
else{
output[i] = "Impossible";
}
}
for (int j = 0; j < n; j++) {
System.out.println(output[j]);
}
asdasdasdasd
}
}