Advertisement
tanijja

CoordinateSystem

May 27th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class _01_CartesianCoordinateSystem {
  5.     public static void main(String[] args) {
  6.         Scanner input =new Scanner(System.in);
  7.        
  8.         int x = input.nextInt();
  9.         int y = input.nextInt();
  10.        
  11.         if (x==0 ) {
  12.             System.out.println(6);
  13.         }
  14.  
  15.         if (y==0 ) {
  16.             System.out.println(5);
  17.         }
  18.  
  19.         if (x==0 && y==0 ) {
  20.             System.out.println(0);
  21.         }
  22.  
  23.         if (x>0 && y>0 ) {
  24.             System.out.println(1);
  25.         }
  26.  
  27.         if (x<0 && y>0 ) {
  28.             System.out.println(2);
  29.         }
  30.  
  31.         if (x<0 && y<0 ) {
  32.             System.out.println(3);
  33.         }
  34.  
  35.         if (x>0 && y<0) {
  36.             System.out.println(4);
  37.         }
  38.  
  39.     }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement