Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Exams;
- import java.util.Scanner;
- public class SimpleCalculation {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int x = input.nextInt();
- int y = input.nextInt();
- if (x > 0 && y > 0) {
- System.out.println("1");
- }
- else if (x > 0 && y < 0) {
- System.out.println("4");
- }
- else if (x < 0 && y > 0) {
- System.out.println("2");
- }
- else if (x < 0 && y < 0) {
- System.out.println("3");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment