-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheje3080.java
More file actions
33 lines (32 loc) · 1021 Bytes
/
eje3080.java
File metadata and controls
33 lines (32 loc) · 1021 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
import java.util.Scanner;
public class eje3080
{
public static void main(String [] args){
Scanner lee = new Scanner(System.in);
int c = Integer.parseInt(lee.nextLine());
for(int i=0; i<c; i++){
int n1 = Integer.parseInt(lee.nextLine());
String op = lee.nextLine();
int n2 = Integer.parseInt(lee.nextLine());
String ig = lee.nextLine();
int r = Integer.parseInt(lee.nextLine());
int opera=0;
if(op.equals("+"))
opera = n1+n2;
else if(op.equals("-"))
opera = n1-n2;
else if(op.equals("*"))
opera = n1*n2;
else if(n2==0){
System.out.println("No");
break;
}
else if(op.equals("/"))
opera = n1/n2;
if(r == opera)
System.out.println("Yes");
else
System.out.println("No");
}
}
}