-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUri1041.java
More file actions
37 lines (32 loc) · 803 Bytes
/
Uri1041.java
File metadata and controls
37 lines (32 loc) · 803 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
36
37
import java.util.Scanner;
class Uri1041{
public static void main(String[] args){
double x,y;
String quadrante = null;
Scanner input = new Scanner(System.in);
x = input.nextDouble();
y = input.nextDouble();
if(x > 0 && y > 0){
quadrante = "Q1";
}
if (x > 0 && y < 0){
quadrante = "Q4";
}
if (x < 0 && y > 0){
quadrante = "Q2";
}
if (x < 0 && y < 0){
quadrante = "Q3";
}
if (x == 0 && y == 0){
quadrante = "Origem";
}
if(x == 0 && y != 0){
quadrante = "Eixo Y";
}
if(x != 0 && y == 0){
quadrante = "Eixo X";
}
System.out.println(quadrante);
}
}