[백준 1064번] 평행사변형 (C++)
문제링크 : https://www.acmicpc.net/problem/1064#include using namespace std;struct Point { double x, y;};double distance(Point a, Point b) //거리 구하기{ double dx = a.x - b.x; double dy = a.y - b.y; return sqrt(dx * dx + dy * dy);}bool isColinear(Point a, Point b, Point c) //세 점이 일직선에 있는 지 체크{ return (b.x - a.x)*(c.y - a.y) == (b.y - a.y)*(c.x - a.x);}int main() { Point a, b, c; ci..
백준/실버
2025. 4. 14. 20:40