rn x; gety () return y;
};
////////////////////////////////////////// ///kola;
////////////////////////////////////////// // mnogougolnik
{kol; class kola; * tochki;: dat (); show ();
};
////////////////////////////////////////// /////kola
{
int ymlong; * r;: ymlength (); setr (mnogougolnik mnog); show (mnogougolnik mnog);
};
///--------------------------- main (void)
{mnog; ko;. dat (); gdriver = DETECT, gmode, errorcode; (& gdriver, & gmode, "C: Bc bin "); = graphresult (); (errorcode! = grOk)
{
printf ("Graphics error:% s n", grapherrormsg (errorcode)); ("Press any key to halt:"); (); (1);
}
setbkcolor (1); (6);. show (); ();. ymlength ();. setr (mnog);. show (mnog); (); (); () ;
}
///---------------------------- mnogougolnik :: dat ()
{
char str [100]; i, x, y; * f; f = fopen ("A: my.txt", "r");
fgets (str, 100, f);
for (i = 0;! feof (f); i + +) (str, 100, f); = i; = new tochka [kol];
rewind (f);
fgets (str, 100, f);
for (i = 0; i
{
fscanf (f, "% s% 2s% d% s% 2s% d% s n", str, str, & x, str, str, & y, str) ;
tochki [i]. set (x, y);
}
fclose (f);
}
///////////////////////////////kola :: ymlength ()
{
char str [100]; * f;
f = fopen ("A: my1.txt", "r");
fgets (str, 100, f);
fscanf (f, "% s% s% s% s% s% s% d", str, str, str, str, str, str, & ymlong);
fclose (f);
}
/////////////////////////////////
void kola :: setr (mnogougolnik mnog)
{
int N = mnog.kol; = new int [N]; r1, r2; i; (i = 0; i
{
if (i == 0)
r2 = sqrt (pow (mnog.tochki [i]. getx ()-mnog.tochki [N-1]. getx (), 2) +
+ pow (mnog.tochki [i]. gety ()-mnog.tochki [i-1]. gety (), 2));
if (i == N-1) = sqrt (pow (mnog.tochki [i]. getx ()-mnog.tochki [0]. getx (), 2) +
+ pow (mnog.tochki [i]. gety ()-mnog.tochki [0]. gety (), 2));
else = sqrt (pow (mnog.tochki [i]. getx ...