AlexKondov

Java Ordinate System

May 6th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package Exams;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SimpleCalculation {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner input = new Scanner(System.in);
  9.         int x = input.nextInt();
  10.         int y = input.nextInt();
  11.        
  12.         if (x > 0 && y > 0) {
  13.             System.out.println("1");
  14.         }
  15.         else if (x > 0 && y < 0) {
  16.             System.out.println("4");
  17.         }
  18.         else if (x < 0 && y > 0) {
  19.             System.out.println("2");
  20.         }
  21.         else if (x < 0 && y < 0) {
  22.             System.out.println("3");
  23.         }
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment