[boj] (b3) 3009 네 번째 점

강신현·2022년 4월 1일
0

✅ 구현

문제

링크

코드

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main()
{
    int x[3];
    int y[3];
    for (int i = 0; i < 3; i++)
        cin >> x[i] >> y[i];
    if (x[0] == x[1])
        cout << x[2] << " ";
    else if (x[0] == x[2])
        cout << x[1] << " ";
    else
        cout << x[0] << " ";

    if (y[0] == y[1])
        cout << y[2];
    else if (y[0] == y[2])
        cout << y[1];
    else
        cout << y[0];
}
profile
땅콩의 모험 (server)

0개의 댓글