Advertisement
noshin98

uva 10242

Oct 24th, 2016
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. double a1,a2,b1,b2,c1,c2,d1,d2,e1,e2;
  5. while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&a1,&a2,&b1,&b2,&c1,&c2,&d1,&d2)==8)
  6. {
  7. if(a1==b1 && a2==b2)
  8. {e1=c1+d1-a1;
  9. e2=c2+d2-a2;}
  10. else if(a1==c1 && a2==c2)
  11. {e1=b1+d1-a1;
  12. e2=b2+d2-a2;}
  13. else if(a1==d1 && a2==d2)
  14. {e1=c1+b1-a1;
  15. e2=c2+b2-a2;}
  16. else if(b1==c1 && b2==c2)
  17. {e1=a1+d1-b1;
  18. e2=a2+d2-b2;}
  19. else if(b1==d1 && b2==d2)
  20. {e1=a1+c1-b1;
  21. e2=a2+c2-b2;}
  22. else if(c1==d1 && c2==d2)
  23. {e1=b1+a1-c1;
  24. e2=b2+a2-c2;}
  25. printf("%.3lf %.3lf\n",e1,e2);
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement