Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Solution {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int x=sc.nextInt(),y=sc.nextInt();
- if(x==0&&y==0){
- System.out.println("Origin");
- }else if(x==0){
- System.out.println("Y axis");
- }else if(y==0){
- System.out.println("X axis");
- }else{
- if(x>0&&y>0){
- System.out.println("Quadrant 1");
- }else if(x<0&&y>0){
- System.out.println("Quadrant 2");
- }else if(x<0&&y<0){
- System.out.println("Quadrant 3");
- }else{
- System.out.println("Quadrant 4");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment