ходиться в розкладці Dialog;
Взаємозв'язок функцій
4. НАБІР ТЕСТІВ
Вихідні дані:
5. ТЕКСТ ПРОГРАМИ МОВОЮ С + +
# include
# pragma hdrstop
# include
# include
# include
# include
# include
# include «windows.h»
# include
# include «Unit1.h»
/ / ---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma link «Excel_2K_SRVR»
# pragma resource «*. dfm» * Form1; C, M, N, strok=0; int ** Matrix; float * X; float * Y; double * mark; fot=true ; point {X, Y;
} p [100]; Put {
int Nach, Kon, Ves;
} e [100];
struct Min {mm, ch;
} m [100]; MIN (TStringGrid * GRID, int i)
{[i]. mm=999999; (int j=1; j <= strok; j + +) ((e [j]. Nach == i) && (m [i ]. mm> StrToInt (GRID-> Cells [5] [j])))
{[i]. mm=StrToInt (GRID-> Cells [5] [j]); [i]. ch=strok;
}
} float M_RAD_CONV=M_PI/180.0; GetAngle (float x1, float y1, float x2, float y2)
{res=0; (y1 == y2)
{(x2>=x1)=0; (x2
} else (x1 == x2)
{(y2 == y1)=0; (y2> y1)=90.0 * M_RAD_CONV; (y2
}
{= atan2 (y2-y1, x2-x1); (res <0)
{= res * - 1;=M_PI-res + M_PI;
}
} res;
} DrawArrow (TCanvas * Canvas, float x1, float y1, float x2, float y2, int radius)
{ArrowCone=30;ArrowConeLength=10;angle=GetAngle(x2,y2,x1,y1);=cos(angle)*radius+x2;=sin(angle)*radius+y2;=cos(angle+M_PI)*radius+x1;=sin(angle+M_PI)*radius+y1;>MoveTo(x2,y2);>LineTo(x1,y1);tangle=angle+(M_PI-ArrowCone*M_RAD_CONV);tx=cos(tangle)*ArrowConeLength+x1;ty=sin(tangle)*ArrowConeLength+y1;>LineTo(tx,ty);=angle+(M_PI+ArrowCone*M_RAD_CONV);=cos(tangle)*ArrowConeLength+x1;=sin(tangle)*ArrowConeLength+y1;>MoveTo(x1,y1);>LineTo(tx,ty);
} Node {(int _id):
id (_id), (0), (new Node * [100]), (new int [100])
{}
~ Node () {[] connections; [] weightConnections;
} id; ** connections; * weightConnections; countConnections; connect (Node * node, int weight) {[countConnections]=node; [countConnections + +]=weight;
}
}; ** countWork; ** workTime; getCountWork (Node * node, int count) {(int i=0; i countConnections; i + +) ((node-> id!=node-> connections [i] -> id) &&
((countWork [node-> id] [node-> connections [i] -> id] == - 1) | |
...