알고리즘/백준 알고리즘

14681 - 사분면 고르기

TIM_0529 2023. 1. 8. 06:54
반응형
#include <iostream>
using namespace std;

int main()
{
	int x, y, c=0;
	cin >> x;
	cin >> y;
	if (x > 0 && y > 0)
		cout << 1;
	if (x > 0 && y < 0)
		cout << 4;
	if (x < 0 && y < 0)
		cout << 3;
	if (x < 0 && y>0)
		cout << 2;
	
}
반응형

'알고리즘 > 백준 알고리즘' 카테고리의 다른 글

[백준] 2884 - 알림시계  (0) 2023.01.10
[백준] 2839 - 설탕 배달  (0) 2023.01.09
[백준] 2753 - 윤년  (0) 2023.01.07
[백준] 2775 - 부녀회장이 될테야  (0) 2023.01.06
[백준] 9498 - 시험성적  (0) 2023.01.05