Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  2.  
  3. int a = Integer.parseInt(reader.readLine());
  4. int b = Integer.parseInt(reader.readLine());
  5. System.out.println(Coordinate(a,b));
  6. }
  7.  
  8. public static int Coordinate(int a, int b) {
  9.  
  10. int x = 0;
  11. if (a > 0 && b > 0) x = 1 ;
  12. if (a < 0 && b > 0) x = 2 ;
  13. if (a < 0 && b < 0) x = 3 ;
  14. if (a > 0 && b < 0) x = 4 ;
  15.  
  16. return x;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement