Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- INT main() {
- 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 << 4;
- }
- ELSE{
- cout << 2;
- }
- }
- ELSE{
- IF (a==c&&b==d&&e==f){
- cout<< 2 <<endl;
- }
- ELSE IF(e == f){
- cout<<"1"<<endl;
- }
- ELSE{
- cout << 0;
- }
- }
- RETURN 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement