1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】3.选择结构2/7-5 选择-我是特种兵.c

20 lines
415 B
C

#include <stdio.h>
int main() {
int x1, y1, x2, y2, x3, y3;
scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
int d1 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
int d2 = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);
int d3 = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
if (d1 + d2 == d3) {
printf("yes\n");
} else {
printf("no\n");
}
return 0;
}