fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. float x = in.nextFloat(), y = in.nextFloat();
  11. if (x > 0 && y > 0) {
  12. System.out.println("1");
  13. }
  14. else if (x < 0 && y > 0) {
  15. System.out.println("2");
  16. }
  17. else if (x < 0 && y < 0) {
  18. System.out.println("3");
  19. }
  20. else if (x > 0 && y < 0) {
  21. System.out.println("4");
  22. }
  23. else {
  24. System.out.println("0");
  25. }
  26. }
  27. }
Success #stdin #stdout 0.07s 2184192KB
stdin
-1 -1
stdout
3