#include #include #include #include using namespace std; int n; int x[30],y[30]; /** * @explanation 坐标点类 */ class Coordinate { public: double xCoordinate; double yCoordinate; Coordinate(double x = 0,double y = 0) { this->xCoordinate = x; this->yCoordinate = y; } bool operator!=(Coordinate const &comp) const { return (this->xCoordinate != comp.xCoordinate || this->yCoordinate != comp.yCoordinate); } }array[10]; /** * @explanation 判断是否为等腰直角三角形. */ bool Judge(Coordinate const x,Coordinate const y,Coordinate const z) { Coordinate *mVector = new Coordinate(x.xCoordinate - y.xCoordinate, x.yCoordinate - y.yCoordinate); Coordinate *nVector = new Coordinate(z.xCoordinate - (x.xCoordinate + y.xCoordinate)/2, z.yCoordinate - (x.yCoordinate + y.yCoordinate)/2); //判断是否为等腰三角形 bool result = ((mVector->xCoordinate * nVector->xCoordinate + mVector->yCoordinate * nVector->yCoordinate) == 0); //判断是否是直角三角形 if(result) result = (mVector->xCoordinate * mVector->xCoordinate + mVector->yCoordinate * mVector->yCoordinate) == ((nVector->xCoordinate * nVector->xCoordinate + nVector->yCoordinate * nVector->yCoordinate) * 4); delete mVector; delete nVector; return result; } bool IsSquare(Coordinate *array,int length) { if(length != 4) return false; int a,b,c; if(Judge(array[0],array[1],array[2])) { a = 0; b = 1; c = 2; } else if(Judge(array[0],array[2],array[1])) { a = 0; b = 2; c = 1; } else if(Judge(array[2],array[1],array[0])) { a = 1; b = 2; c = 0; } else return false; return (array[3] != array[c] && Judge(array[a],array[b],array[3])); } int main() { while(~scanf("%d",&n)){ int ans=0; for(int i=0;i