https://www.acmicpc.net/problem/9772
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
def sol(x, y):
if x == 0 or y == 0:
return 'AXIS'
elif x > 0 and y > 0:
return 'Q1'
elif x < 0 and y > 0:
return 'Q2'
elif x < 0 and y < 0:
return 'Q3'
elif x > 0 and y < 0:
return 'Q4'
if __name__ == '__main__':
while True:
x, y = map(float, input().split())
print(sol(x, y))
if x == 0 and y == 0:
break
|
cs |
단순하게 사분면 구하는 문제입니다.
It's a simple quadrant problem.
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2. Add Two Numbers (0) | 2023.02.17 |
---|---|
leetcode 206. Reverse Linked List (0) | 2023.02.17 |
leetcode 989. Add to Array-Form of Integer (0) | 2023.02.15 |
leetcode 21. Merge Two Sorted Lists (0) | 2023.02.13 |
leetcode 1523. Count Odd Numbers in an Interval Range (0) | 2023.02.13 |
댓글