728x90

소스코드
#include <stdio.h>
int main() {
int x, y;
scanf("%d %d", &x, &y);
x > 0 ? printf("%d", y > 0 ? 1 : 4) : printf("%d", y > 0 ? 2 : 3);
}
출처
14681번: 사분면 고르기
점 (x, y)의 사분면 번호(1, 2, 3, 4 중 하나)를 출력한다.
www.acmicpc.net
728x90
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 15552] 빠른 A+B [C] (0) | 2021.07.18 |
---|---|
[백준 8393] 합 [C] (0) | 2021.07.18 |
[백준 2588] 곱셈 [C] (0) | 2021.07.18 |
[백준 10430] 나머지 [C] (0) | 2021.07.18 |
[백준 2750] 수 정렬하기 [C] (0) | 2021.07.18 |