기하 #CCW1 백준 11758 c++ -PlusUltraCode CCW알고리즘을 알고 있으면 쉽게 풀수 있는 문제이다. /* x1 x2 x3 x1*/ /* y1 y2 y3 y1*/ CCW알고리즘은 이런식으로 대각선끼리 곱해주고 빼주면 된다. [소스코드] #include #include #include #include #include #include using namespace std; int main(void) { int x1, x2, x3, y1, y2, y3; /* x1 x2 x3 x1*/ /* y1 y2 y3 y1*/ cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; int CCW = ( (x1 * y2) + (x2 * y3) + (x3 * y1) ) - ((x2* y1) + (x3 * y2) + (x1 * y3)); if (CCW > 0.. 2024. 2. 15. 이전 1 다음