사분면
https://www.acmicpc.net/problem/9610
import sys
n = int(input())
Q1=0
Q2=0
Q3=0
Q4=0
AXIS=0
for i in range(n) :
x,y = map(int,input().split())
if x==0 or y==0 : AXIS+=1
elif x > 0 :
if y > 0 : Q1 +=1
else : Q4 +=1
else :
if y > 0 : Q2 +=1
else : Q3+=1
print(f'Q1: {Q1}')
print(f'Q2: {Q2}')
print(f'Q3: {Q3}')
print(f'Q4: {Q4}')
print(f'AXIS: {AXIS}')
'PROGRAMMING CODE > PYTHON' 카테고리의 다른 글
[BAEKJOON] No.12865 Python (0) | 2023.03.23 |
---|---|
[BAEKJOON] No.9506 Python (0) | 2023.03.22 |
[BAEKJOON] No.10988 Python (0) | 2023.03.22 |
[BAEKJOON] No. 2754 Python (0) | 2023.03.21 |
[BAEKJOON] No.3009 Python (0) | 2023.03.21 |