Written by
java-style
on
on
[백준 BAEKJOON] 14681번 사분면 고르기 문제 (JAVA)
[백준 BAEKJOON] 14681번 사분면 고르기 문제 (JAVA)
문제
소스코드
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); if( 0 < x && 0 < y) { // 제 1사분면 System.out.println("1"); }else if( 0 > x && 0 < y ) { // 제 2사분면 System.out.println("2"); }else if( 0 > x && 0 > y ) { // 제 3사분면 System.out.println("3"); }else if( 0 < x && 0 > y ) { // 제 4사분면 System.out.println("4"); } } //main } //class
from http://choitaetae.tistory.com/38 by ccl(A) rewrite - 2021-09-05 22:27:11