* P2)
} Diagon (pryamokut A)
{a1, c1, a2, c2, b1 = -1, b2 = -1, X, Y; (AAx! = ACx)
{= (ACy-AAy)/(ACx-AAx); = AAy-a1 * AAx;
} (A.B.x! = A.D.x)
{= (ADy-ABy)/(ADx-ABx); = ADy-a2 * ADx;
} ((a1 * b2-a2 * b1)! = 0)
{= (b1 * c2-c1 * b2)/(a1 * b2-a2 * b1); = (a2 * c1-a1 * c2)/(a1 * b2-a2 * b1) ;
} (AAx, AAy, ACx, ACy); (ABx, ABy, ADx, ADy); Point;. x = X;. y = Y; Point;
} Diag (pryamokut A, pryamokut B)
{W1, W2; (& W1, Diagon (A)); (& W2, Diagon (B)); (14); (W1.x, W1.y, W2. x, W2.y);
} main ()
{s, str [100]; q = 0; gdriver = DETECT, gmode, errorcode; (& gdriver, & gmode,
{(s == '=') q + +;
} = q/8; * P = new pryamokut [q]; (f1); I, J, K, L; (int i = 0; i
(P + i) -> setdata (I, J, K, L);
(P + i) -> draw ();
}> grup = 1; (i = 0; i grup == n) ((P + j) -> mit == 0) (i! = j)
{(Vklad (& P [i], & P [j]) == 1)
{[j]. grup = n; [j]. mit = 1;
} P [j]. grup = n +1;
} (i = 0; i grup == n) ((P + i) -> mit == 1)
{[n] = kilk [n] +1;
} maxg = 1, ming = 1; max = kilk [1]; min = kilk [1]; (i = 0; i 1)
{(kilk [n]> max)
{= kilk [n]; = n;
} if (kilk [n]
{= kilk [n]; = n;
}
} (); maxs, mins; minz, maxz; (i = 0; i
{((P + i) -> grup == maxg)
{(4); = (P + i) -> S; = i;
(P + i) -> draw ();
} if ((P + i) -> grup == ming)
{(3); = (P + i) -> S; = i;
(P + i) -> draw ();
}
} (i = 0; i
{(P [i]. grup == maxg)
{(P [i]. S> maxs)
{= P [i]. S; = i;
}
} (P [i]. grup == ming)
{(mins> P [i]. S)
{= P [i]. S; = i;
}
}
} (); (5); [maxz]. draw (); [minz]. draw (); (); (11); (P [minz], P [maxz]) ; (); (); 0;
}
Додаток Б
...