본문 바로가기
Programming Practice/C++

백준 3009 C++

by TAMIK 2023. 9. 1.
728x90

#include <iostream>
using namespace std;

int main() {
	int x1, y1, x2, y2, x3, y3, x4, y4;
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

	x4 = x1;
	y4 = y1;
	if (x4 == x2)
		x4 = x3;
	else if (x4 == x3)
		x4 = x2;
	
	if (y4 == y2)
		y4 = y3;
	else if (y4 == y3)
		y4 = y2;

	cout << x4 << " " << y4 << endl;
}

 

728x90

'Programming Practice > C++' 카테고리의 다른 글

백준 10807 개수 세기 | C++  (0) 2023.09.07
백준 10156 C++  (0) 2023.09.01
백준 2530 C++  (0) 2023.08.30
백준 수학 문제  (1) 2023.01.17
배열  (0) 2023.01.17