알고리즘

[알고리즘] 백준 9610 - 사분면

blueberrysoda 2024. 7. 21. 23:41
#include <iostream>
using namespace std;

int N;
int A, B, C, D, X;

int main(){
    cin >> N;
    int a, b;
    for(int i=0; i<N; i++){
        cin >> a >> b;
        if(a == 0 || b == 0){
            X++;
        }
        else if(a > 0 && b > 0){
            A++;
        }
        else if(a < 0 && b > 0){
            B++;
        }
        else if(a < 0 && b < 0){
            C++;
        }
        else if(a > 0 && b < 0){
            D++;
        }
    }
    cout << "Q1: " << A << "\n";
    cout << "Q2: " << B << "\n";
    cout << "Q3: " << C << "\n";
    cout << "Q4: " << D << "\n";
    cout << "AXIS: " << X << "\n";
    return 0;
}