50078. Parallelogram
難度:1/51
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31#include <stdio.h>
#include <stdlib.h>
typedef struct{
int x, y;
} s_pt;
s_pt add(s_pt a, s_pt b){
s_pt rtv;
rtv.x = a.x + b.x;
rtv.y = a.y + b.y;
return rtv;
}
s_pt minus(s_pt a, s_pt b){
s_pt rtv;
rtv.x = a.x - b.x;
rtv.y = a.y - b.y;
return rtv;
}
int main(){
s_pt a, b, c;
scanf("%d %d %d %d %d %d", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
s_pt d, e, f;
d = add(minus(c, a), b);
e = add(minus(c, b), a);
f = add(minus(b, c), a);
printf("%d\n%d\n%d\n%d\n%d\n%d\n", d.x, d.y, e.x, e.y, f.x, f.y);
}
50078. Parallelogram
https://aaronlin1229.github.io/judgegirl_50078/