Notice
Recent Posts
Recent Comments
Link
«   2026/06   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

dh-winternagi 님의 블로그

(14681) 사분면 고르기 본문

백준 (C++)/Solve

(14681) 사분면 고르기

dh-winternagi 2026. 4. 8. 14:06

https://www.acmicpc.net/problem/14681

단계별로 풀어보기

2단계(조건문) 4번째

 

 

 

어제 풀었지만 티스토리 블로그 글 15개 제한에 걸렸다.

#include <iostream>
using namespace std;

int main() 
{
  int x, y;
  
  cin >> x >> y;
  
  if(x>0 && y>0)  cout << 1;
  else if(x<0 && y>0)  cout << 2;
  else if(x<0 && y<0)  cout << 3;
  else  cout << 4;
  
  return 0;
}

'백준 (C++) > Solve' 카테고리의 다른 글

(2525) 오븐 시계  (0) 2026.04.08
(2884) 알람 시계  (0) 2026.04.08
(2753) 윤년  (0) 2026.04.07
(9498) 시험 성적  (0) 2026.04.07
(1330) 두 수 비교하기  (0) 2026.04.07