Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. INT main() {
  4.     double x1,y1,x2,y2,x3,y3,x4,y4,a,b,c,d,e,f;
  5.     cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
  6.     a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
  7.     b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
  8.     c=sqrt((x3-x4)*(x3-x4)+(y3-y4)*(y3-y4));
  9.     d=sqrt((x1-x4)*(x1-x4)+(y1-y4)*(y1-y4));
  10.     e=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
  11.     f=sqrt((x2-x4)*(x2-x4)+(y2-y4)*(y2-y4));
  12.     IF (a==b&&b==c&&c==d){
  13.         IF (e==f){
  14.             cout << 4;
  15.         }
  16.         ELSE{
  17.             cout << 2;
  18.         }
  19.     }
  20.     ELSE{
  21.         IF (a==c&&b==d&&e==f){
  22.             cout<< 2 <<endl;
  23.         }
  24.         ELSE IF(e == f){
  25.             cout<<"1"<<endl;
  26.         }
  27.         ELSE{
  28.             cout << 0;
  29.         }
  30.     }
  31.     RETURN 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement