Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- long long n;
- cin>>n;
- for(int i=1;i<=n;++i)
- {
- double x1,y1,x2,y2,x3,y3,x4,y4,a,b,c,d,e,f;
- cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
- a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
- b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
- c=sqrt((x3-x4)*(x3-x4)+(y3-y4)*(y3-y4));
- d=sqrt((x1-x4)*(x1-x4)+(y1-y4)*(y1-y4));
- e=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
- f=sqrt((x2-x4)*(x2-x4)+(y2-y4)*(y2-y4));
- if (a==b&&b==c&&c==d)
- {
- if (e==f)
- cout<<"Case "<<i<<": Square"<<endl;
- else
- cout<<"Case "<<i<<": Rhombus"<< endl;
- }
- else
- {
- if (a==c&&b==d)
- cout<<"Case "<<i<<": Rectangle"<<endl;
- else
- cout<<"Case "<<i<<": Other"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement