Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1. public static int quadrant(int x, int y) {
  2.     if (x == 0 || y == 0)
  3.         return 0;
  4.  
  5.     if (x > 0) {
  6.         if (y > 0) {
  7.             return 1;
  8.         } else {
  9.             return 4;  
  10.         }
  11.     } else {
  12.         if (y > 0) {
  13.             return 2;
  14.         } else {
  15.             return 3;  
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement