Full width home advertisement

Travel the world

Climb the mountains

Post Page Advertisement [Top]

Java

Solving Quardrant Selection open.kattis.com with Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quardranselection;
import java.util.Scanner;
/**
 *
 * @author user
 */
public class Quardranselection {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int x,y;
        Scanner input = new Scanner(System.in);
        x = input.nextInt();
        y = input.nextInt();
        if(x>0 && y>0){
            System.out.println("1");
        }else if(x<0 && y>0){
            System.out.println("2");
       }else if(x<0 && y<0){
            System.out.println("3");
            }else if(x>0 && y<0){
            System.out.println("4");
        }
    }
 
}

Program diatas yang sudah saya berikan anda dapat mencobanya dengan seksama !!!

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib