7月4日 Fourth Point !!

Fourth Point !!

#include <iostream>
using namespace std;
class point {
public:
double x;
double y;
bool equals(const point &p) {
if (p.x == x && p.y == y)
return true;
return false;
}
};
int main() {
point a, b, c, d;
while (cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y) {
point e;
if (a.equals(c)) {
swap(a, b);
} else if (a.equals(d)) {
swap(a, b);
swap(c, d);
} else if (b.equals(d)) {
swap(c, d);
}
e.x = d.x + a.x - b.x;
e.y = a.y + d.y - b.y;
printf("%.3f %.3f\n", e.x, e.y);
}
return 0;
}
posted @   tlocd  阅读(11)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示