Advertisement
next129

uva 10242

May 15th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. struct point{
  5. double x;
  6. double y;
  7. };
  8.  
  9. void func(double x1,double x2,double x3,double y1,double y2,double y3){
  10. cout<<fixed<<setprecision(3)<<(x1+x2)-x3<<" "<<(y1+y2)-y3<<endl;
  11. }
  12. int main()
  13. {
  14. point a,b,c,d;
  15. while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&d.x,&d.y) == 8){
  16. if(a.x == b.x && a.x == b.y){
  17. func(c.x,d.x,a.x,c.y,d.y,a.y);
  18. }
  19. else if(a.x == c.x && a.y == c.y){
  20. func(b.x,d.x,a.x,b.y,d.y,a.y);
  21. }
  22. else if(a.x == d.x && a.y == d.y){
  23. func(b.x,c.x,a.x,b.y,c.y,a.y);
  24. }
  25. else if(b.x == c.x && b.y == c.y){
  26. func(a.x,d.x,b.x,a.y,d.y,b.y);
  27. }
  28. else if(b.x == d.x && b.y == d.y){
  29. func(a.x,c.x,b.x,a.y,c.y,b.y);
  30. }
  31. else{
  32. func(a.x,b.x,c.x,a.y,b.y,c.y);
  33. }
  34. }
  35. // cout<<a.x<<" "<<a.y<<endl;
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement