728x90
반응형
백준 BAEKJOON 14681번 사분면 고르기 [PYTHON/파이썬]
<문제 출처>
https://www.acmicpc.net/problem/14681
<풀이>
1 사분면 (x,y) = (+, +)
2 사분면 (x,y) = (-, +)
3 사분면 (x,y) = (-, -)
4 사분면 (x,y) = (+, -)
참고 하면 된다.
<코드>
x = int(input())
y = int(input())
if (x>0 and y>0):
print('1')
elif (x<0 and y>0) :
print('2')
elif (x<0 and y<0) :
print('3')
else :
print('4')
728x90
반응형
'ALGORITHM > PYTHON' 카테고리의 다른 글
백준 BAEKJOON 2525번 오븐 시계 [PYTHON/파이썬] (0) | 2022.08.28 |
---|---|
백준 BAEKJOON 2884번 알람 시계 [PYTHON/파이썬] (0) | 2022.08.28 |
백준 BAEKJOON 3003번 킹, 퀸, 룩, 비숍, 나이트, 폰 [PYTHON/파이썬] (0) | 2022.08.28 |
백준 BAEKJOON 2753번 윤년 [PYTHON/파이썬] (0) | 2022.07.17 |
백준 BAEKJOON 9498번 시험 성적 [PYTHON/파이썬] (0) | 2022.07.17 |