14681. 사분면 고르기

py_code·2020년 11월 18일
0

백준-브론즈4

목록 보기
12/51

solution 1 : print 내부 분기 없음

x, y = int(input()), int(input())
if x > 0:
    if y>0: print(1)
    else: print(4)
else:
    if y>0: print(2)
    else: print(3)

solution 2 : print 내부 분기로 좀 더 축약

x, y = int(input()), int(input())
if x > 0:
    print(1 if y>0 else 4)
else:
    print(2 if y>0 else 3)
profile
개발자를 꿈꿉니다.

0개의 댓글