• :
  • : ,











: « »

« »



: . . -23

.

: .. ..







2011

, . , . . , , , . .



.1 -

.2

.2.1 -

.2.2

.2.3

2

2.1

.1

.2

.3

.4

.1 24

.2

.

.



, « », - , .

:

  • ;
  • , ;
  • ;
  • , , , ;
  • .
  • - - . . ?0/2 (?0 - ). . . . - , , , , .
  • 1
  • (-) . - . . . . .
  • 1.1 -
  • 1, 2, , m , i ai (i = 1, ..., m). , B1, B2, , Bn, j bj (j = 1, , n).
  • , . i j cij (i = 1, ..., m, j = 1, , n).
  • , , .
  • : .
  • 1.2
  • , , -.
  • . , . , i j, , cij. , cij, - . -.
  • :
  • - ;
  • ;
  • .
  • .
  • 1.2.1 -
  • n*m. - . : ; . , , b, , . , . .
  • 1.2.2
  • . , 1- . - .
  • :
  • ;
  • - .
  • 1.2.3
  • () . . . .
  • , . , .
  • :
  • .

:

. ,

ij=Ui-Vj;=1;

. :

0=C-(Ui-Vj)

. . 0 , . .

. 0 , d. . 0+.

. , . . , . , ..

, . , , 0+, , .

, , - .

, Q.=min{Q-}, , . , .

. , , 0 ( ) .

. := L - |d|*Q

. :

) , .

) , . , , . , , .

) , . + |d|, -|d|. 3.


2


i , j.

, i , .

( ), () ( ) () i j 1.1.


2.1 -

iB1B2B324A112147.23100A21512.43.1550A37.7182212004231917.1185021004080520

.1


«». 4 , , - , , . 3100, 550, 1200 1850 . - , . 2100, 4080 520 . "" . ( 1.2).


2.2 -

, ./ , 12147.231001512.43.15507.718221200231917.11850, 21004080520

, ( ), () , .


3


: , .

:


di = i = 1..m


:


dj = j = 1..n


, . 4.1. , . :

, 0.


.1


, . .

. 0. 0, 0 . , , .

. . + , . . ( ), +, .


.2


, . , , . , .

, . . , . , +. , , *, , . , , , .


3.3


, , , .

: , . : , , *, . Q = min {di, dj, " *ij Î }

, . , , Q, Q.


.4


, .


3.1 -


4


.1


, . ij, ( ) .


.2


(ij) , : ij*ij. L, : ij, L .


.3


, , , , .

:






5


.1 24


5.1.


5.1 - 24

Ai:12147.231001512.43.15507.718221200231917.11850Bj210040805206700

:

, .


5.1.1

, . .

, . 0. 0 :


0:2.702.57.30005.618.98.707.4 0 0:


Ai0:310005500120004301420Bj9000520

0, .

· :

b1=2100-1200=900;

b2=4800-980-430=0;

b3=520-0=520;

· :

1=3100-3100=0;

2=550-550=0;

3=1200-1200=0;

4=1850-430=1420;

. .


.1.2

+ . - .



+2.72.5C0:7.305.618.98.77.4

0 . : a=0 . , +. , , , *, : (+). , - 4. .


(+)2.72.5+C0:7.3*0'+'5.618.9+8.7'7.4

, , , *, , . :

. . , Xij, 0*. =min{1420, 520, 550}=520.


(+)2.7'2.5+C0:7.3*0'+'5.618.9+8.7'7.4

=520 Xij, ij=0, =520 Xij, Cij=0*:


Ai1:3100030520012000950900Bj90000

.

· :

b1=2100-1200=900;

b2=4800-3100-30-950=0;

b3=520-520=0;

· :

1=3100-3100=0;

2=550-30-520=0;

3=1200-1200=0;

4=1850-1850=0;

1:.. .


.1.3

+ . - .


++2.72.5C0:7.30'5.618.9+8.77.4

, 0 , , 0.

0 h=min{2.7, 7.3, 8.7}=2.7; h . 1:


002.5C14.60008.321.6607.4

+ . - .

++2.5C14.68.321.667.4

1 . : a=0 . , +. , , , *, : (+). , - 4. .


(+)(+)'*2.5+C14.6'*+'8.321.6+6'7.4

, , , *, , . :

(+)(+)'*2.5+C14.6'*+'8.321.6+6'7.4

. . , Xij, 0*. =min{900, 900, 3100}=900;

=900 Xij, ij=0, =900 Xij, Cij=0*:


Ai1:900220003052001200018500Bj000

.

· :

b1=2100-1200-900=0;

b2=4800-2200-30-1850=0;

b3=520-520=0;

· :

1=3100-900-2200=0;

2=550-30-530=0;

3=1200-1200=0;

4=1850-950=900;

:

L=900*12+2200*14+30*12.4+520*3.1+1200*7.7+1850*19=87974.


5.2


Builder ++, . () 5.1.


5.1 -


. 1 . , . 5.2 - 5.6.


5.2 -


5.3 -

5.4 -


5.5 -


5.6-


6


.

:


Ai:12147.231001512.43.15507.718221200231917.11850Bj210040805206700

opt, :


Aiopt:900220003052001200018500Bj000

L = 87974 [].

:








.

  1. , .

L


Li - , opt.

L1 = 900*12 + 2200*14 =41600 [.].

L2 = 30*12.4 + 520*3.1=1984 [.].

L3 = 1200*7.7= 9240 [.].

L4 = 1850*19= 35150 [.].

1, L1 , 2, , .

, . 0 < D £ max Ai (i=1,4), 1=3100, 2=550, 3=1200 4=1850, max Ai(i=1..4)=A1=3100. 0<<3100.

:

= (3000, 650, 1200, 1850),

= (2900, 750, 1200, 1850),

= (2800, 850, 1200, 1850),

= (1000, 2650, 1200, 1850),

= (990, 2660, 1200, 1850),

= (960, 2690, 1200, 1850),

= (930, 2720, 1200, 1850),

= (900, 2750, 1200, 1850).

, , = (900, 2750, 1200, 1850), . opt:


Ai'opt:9000223052001200018500Bj000

:








L = 84454 .

D 0 < D < 2200.

) . 6.1.


6.1 -

01234567891011a131002900270025002300210019001700150013001100900a2550750950115013501550175019502150235025502750a3120012001200120012001200120012001200120012001200a4185018501850185018501850185018501850185018501850DL, 032064096012801600192022402560288032003520L, 879748765487334870148669486374860548573485414850948477484454

6.1 -


, 1 () 2200 2 (), 3520 . 84454 .



, . , , , , .

, . .

C++ Builder. . , , 87974 , 3520 , 2200 , . 84454 .

, .



1. .. [] / .. . - .: , 1985. - 174.

. .. [] / .. - .: . , 1979. - 156.

. .. « » 7.080401 - « » [] / .. , .. - : - , 1997. - 26.

. .. - 7.080401 - « » [] / .. , .. - : - , 1998. - 61.




. 1 2 .


1 -


9 . . ->C ->O . -> , .


2 -


() .




//---------------------------------------------------------------------------

#include <vcl.h>

#include <string>

#include <math.h>

#include <fstream.h>

#pragma hdrstop

#include "Main.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma link "Spin"

#pragma link "IWImageList"

#pragma link "cspin"

#pragma resource "*.dfm"*Form1;MyFName="";Cn,Cm;**C;**C0;**CS;Pm;*P;Zn;*Z;Dn,Dm;**D;OPrz=0;OPtr=0;Xn,Xm;**X;Nn,Nm;**N;posl;pstr;*Sheet;*Grid;*GrX;* LabelC;* LabelX;Fn;*F;Gm;*G;*GridF;L;Lstr;Cep[50][7][8];nomer=0;NKor=0;NIter=0;

//

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

// //

void __fastcall TForm1::FormCreate(TObject *Sender)

{

StoimPer->Cells[0][0]="Ai";

for (int j=1; j<StoimPer->ColCount; j++)

{

StoimPer->Cells[j][0]="B"+IntToStr(j);

}

for (int i=1;i<StoimPer->RowCount; i++)

{

StoimPer->Cells[0][i]="A"+IntToStr(i);

}

Potr->Cells[0][0]="";

Zapas->Cells[0][0]="";

}

// __fastcall TForm1::TabKeyPress(TObject *Sender, wchar_t &Key)

{

Set <char, 0, 255> Dig;

TStringGrid* Tab=(TStringGrid *)Sender;

Dig<<'0'<<'1'<<'2'<<'3'<<'4'<<'5'<<'6'<<'7'<<'8'<<'9'<<'\b'<<','<<'.'<<VK_RETURN;

if(!Dig.Contains(Key)){

Key=0;

Beep();

}

}

// ""

void __fastcall TForm1::ReshutClick(TObject *Sender)

{

nomer=0;

// C

Cn=StoimPer->RowCount-1;

Cm=StoimPer->ColCount-1;

for(int i=0;i<50;i++)

for(int j=0;j<Cn;j++)

for(int z=0;z<Cm;z++)

Cep[i][j][z]=0;

C=new int*[Cn];

C0=new int*[Cn];

CS=new int*[Cn];

for (int i=0; i<Cn; i++){

C[i]=new int[Cm];

C0[i]=new int[Cm];

CS[i]=new int[Cm];

}

for(int i=1;i<StoimPer->RowCount;i++)

for(int j=1;j<StoimPer->ColCount;j++)

{

if(StoimPer->Cells[j][i]==""){

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

return;

}

else{

C[i-1][j-1]=(int)(StoimPer->Cells[j][i].ToDouble()*100);

C0[i-1][j-1]=(int)(StoimPer->Cells[j][i].ToDouble()*100);

}

}

//

Pm=Potr->ColCount-1;

P=new int[Pm];

for(int i=1;i<Potr->ColCount;i++)

{

if(Potr->Cells[i][0]=="")

{

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

return;

}

else

P[i-1]=(int)(Potr->Cells[i][0].ToDouble()*100);

}

//

Zn=Zapas->RowCount-1;

Z=new int[Zn];

for(int i=1;i<Zapas->RowCount;i++)

{

if(Zapas->Cells[0][i]=="")

{

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

return;

}

else

Z[i-1]=(int)(Zapas->Cells[0][i].ToDouble()*100);

}

for(int i=0;i<Ogran->RowCount;i++)

for(int j=0;j<Ogran->ColCount;j++)

Ogran->Cells[j][i]="10000";

Dn=Ogran->RowCount;

Dm=Ogran->ColCount;

D=new int*[Dn];

for (int i=0; i<Dn; i++)

D[i]=new int[Dm];

for(int i=0;i<Dn;i++)

for(int j=0;j<Dm;j++)

D[i][j]=(int)(Ogran->Cells[j][i].ToDouble()*100);

//

OPrz=0;

OPtr=0;

for(int i=0;i<Zn;i++)

OPrz+=Z[i];

for(int i=0;i<Pm;i++)

OPtr+=P[i];

if(OPrz!=OPtr){

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

return;

}

if(PageControl->PageCount>2){

NIter=0;

for(int i=PageControl->PageCount-1;i>=2;i--)

PageControl->Pages[i]->~TTabSheet();

}

//

for(int j=0;j<Cm;j++)

{

int min=C[0][j];

for(int i=1;i<Cn;i++){

if(C[i][j]<min)

min=C[i][j];

}

for(int i=0;i<Cn;i++){

C[i][j]-=min;

CS[i][j]=C[i][j];

}

}

// C0

for(int i=0;i<Cn;i++){

int min=C[i][0];

for(int j=1;j<Cm;j++)

if(C[i][j]<min)

min=C[i][j];

if (min!=0)

for(int j=0;j<Cm;j++)

C[i][j]-=min;

}

Predv();

//

Xn=Cn;

Xm=Cm;

X=new int*[Xn];

for (int i=0; i<Xn; i++)

X[i]=new int[Xm];

for (int j=0; j<Cm; j++){

for (int i=0; i<Cn; i++){

if(C[i][j]==0){

//

if(D[i][j]<=P[j] && D[i][j]<=Z[i]){

X[i][j]=D[i][j];

P[j]-=X[i][j];

Z[i]-=X[i][j];

}

else{

if(P[j]<Z[i]){

X[i][j]=P[j];

P[j]-=X[i][j];

Z[i]-=X[i][j];

}

else{

X[i][j]=Z[i];

P[j]-=X[i][j];

Z[i]-=X[i][j];

}

}

}

else

X[i][j]=0;

}

}

//

OPrz=0;

OPtr=0;

for(int i=0;i<Zn;i++)

OPrz+=Z[i];

for(int i=0;i<Pm;i++)

OPtr+=P[i];

if((OPrz+OPtr)==0){

//

Izderg->RowCount=Cn;

Izderg->ColCount=Cm;

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

Izderg->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

//

Plan->RowCount=Xn;

Plan->ColCount=Xm;

for(int i=0;i<Xn;i++)

for(int j=0;j<Xm;j++){

if(X[i][j]==0)

Plan->Cells[j][i]="";

else

Plan->Cells[j][i]=FormatFloat("",X[i][j]/100.0);

}

L=0;

Lstr="L=";

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

if(X[i][j]>0)

{

L+=X[i][j]*C0[i][j];

Lstr+=FormatFloat("",C0[i][j]/100.0)+"*"+FormatFloat("",X[i][j]/100.0)+"+";

}

Lstr.Delete(Lstr.Length(),1);

Lstr+="="+FormatFloat("",L/10000.0);

Edit2->Text=Lstr;

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

return;

}

//

Nn=Cn;

Nm=Cm;

N=new int*[Nn];

for (int i=0; i<Nn; i++)

N[i]=new int[Nm];

// -----------------------------------------------------------

while((OPrz+OPtr)!=0)

{

posl=-1;

pstr=-1;

int v=0;

int *Q=new int[Cn*Cm];

//

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

{

if(C[i][j]==0)

{

if(X[i][j]==D[i][j])

N[i][j]=2;//

else{

if(X[i][j]==0)

N[i][j]=0; //

else

N[i][j]=1; //

}

}

else

N[i][j]=-1; //

}

//

Fn=Zn;

F=new int[Fn];

for(int i=0;i<Fn;i++)

F[i]=0;

//

Gm=Pm;

G=new int[Gm];

for(int i=0;i<Gm;i++)

{

if(P[i]==0)//

G[i]=1; //

else

G[i]=0; //

}

bool kor=false; //

bool np; //

while(kor==false)

{

np=false;

for(int j=0;j<Nm;j++)

{

if(G[j]==1) //

continue;

else

{

for(int i=0;i<Nn;i++)

{

if(F[i]==1) //

continue;

if(N[i][j]==0 || N[i][j]==1)//

{

N[i][j]=3;//

if(Z[i]==0) //

{

F[i]=1; //

for(int k=0;k<Cm;k++) //

{

if(G[k]==0) //

continue;

if(N[i][k]==1 || N[i][k]==2)// .

{

N[i][k]=4; //

G[k]=0; //

np=true; //

}

}

}

else

{

kor=true; //

Q[v]=Z[i]; //

v++; //

Q[v]=D[i][j]-X[i][j]; //

v++;

posl=j; //

pstr=i; //

}

}

if(np==true || kor==true)

break;

}

}

if(np==true || kor==true)

break;

}

//

if(np==false && kor==false)

{

bool go=false;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

if((F[i]==1 && G[j]==0) || (F[i]==0 && G[j]==1))

continue;

else

{

if(F[i]==1 && G[j]==1)

{

if(C[i][j]<0)

{

go=true;

break;

}

}

else

{

if(C[i][j]>0)

{

go=true;

break;

}

}

}

}

if(go==true)

break;

}

if(go==false)

{

MessageDlg(L" .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

Edit2->Text="L=0";

return;

}

bool first=true;

int min=0;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

//

if((F[i]==1 && G[j]==0) || (F[i]==0 && G[j]==1))

continue;

else

{

//

if(F[i]==1 && G[j]==1)

{

//

if(first==true)

{

if(C[i][j]<0)

{

min=abs(C[i][j]);

first=false;

}

}

else

{

if(C[i][j]<0)

{

if(abs(C[i][j])<min)

min=abs(C[i][j]);

}

}

}

//

if(F[i]==0 && G[j]==0)

{

if(first==true)

{

if(C[i][j]>0)

{

min=C[i][j];

first=false;

}

}

else

{

if(C[i][j]>0)

{

if(C[i][j]<min)

min=C[i][j];

}

}

}

}

}

}

//

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

//

if((F[i]==1 && G[j]==0) || (F[i]==0 && G[j]==1))

continue;

else

{

//

if(G[j]==1 && F[i]==1)

C[i][j]+=min;

else

C[i][j]-=min;

}

}

}

//

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

if(C[i][j]==0)

{

if(X[i][j]==D[i][j])

N[i][j]=2;

else

{

if(X[i][j]==0)

N[i][j]=0;

else

N[i][j]=1;

}

}

else

N[i][j]=-1;

}

}

delete []F;

F=NULL;

Ecviv();

//

Fn=Zn;

F=new int[Fn];

for(int i=0;i<Fn;i++)

F[i]=0;

}

}

NKor=0;

//

int* Str=new int[Cn*Cm];

int* Stol=new int[Cn*Cm];

int str=0;

int stol=0;

Str[str]=pstr;

Stol[stol]=posl;

Cep[nomer][pstr][posl]=1; //

str++;

stol++;

Stol[stol]=posl; //

stol++;

int stroka=-1;(1)

{(int i=0;i<Cn;i++)

{

if(N[i][Stol[stol-1]]==4) // . 0*

{

stroka=i;

Str[str]=i;

if(Str[str]<Str[str-1]) // 0* 0'

{

if (Stol[stol-2]<Stol[stol-1])// 0* 0'

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=2;//

for(int i=Str[str]+1;i<Str[str-1];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

Cep[nomer][i][Stol[stol-1]]=12; //

elseCep[nomer][i][Stol[stol-1]]=4; //

}

}

else

{

if (Stol[stol-2]>Stol[stol-1])// 0* 0'

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=5;//

for(int i=Str[str]+1;i<Str[str-1];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

Cep[nomer][i][Stol[stol-1]]=12; //

else

Cep[nomer][i][Stol[stol-1]]=4; //

}

}

else //

{

for(int i=Str[str]+1;i<=Str[str-1];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

Cep[nomer][i][Stol[stol-1]]=12; //

else

Cep[nomer][i][Stol[stol-1]]=4; //

}

}

}

}

else // 0* 0'

{

if (Stol[stol-2]<Stol[stol-1])// 0* 0'

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=6;//

for(int i=Str[str-1]+1;i<Str[str];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

Cep[nomer][i][Stol[stol-1]]=12; //

else

Cep[nomer][i][Stol[stol-1]]=4; //

}

}

{

if (Stol[stol-2]>Stol[stol-1])// 0* 0'

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=7;//

for(int i=Str[str-1]+1;i<Str[str];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

Cep[nomer][i][Stol[stol-1]]=12; //

else

Cep[nomer][i][Stol[stol-1]]=4; //

}

}

else //

{

for(int i=Str[str-1];i<Str[str];i++)

{

if(Cep[nomer][i][Stol[stol-1]]==3)

[nomer][i][Stol[stol-1]]=12; //

else

Cep[nomer][i][Stol[stol-1]]=4; //

}

}

}

}

str++;

Q[v]=X[i][Stol[stol-1]];

v++;

break;

}

}

if(stroka==-1)

{

Q[v]=P[Stol[stol-1]];

v++;

break;

}

for(int j=0;j<Cm;j++)

{

if(N[Str[str-1]][j]==3)// . 0'

{

Stol[stol]=j;

if(Stol[stol]<Stol[stol-1])// 0' 0*

{

if (Str[str-2]<Str[str-1]) // 0' 0*

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=2;//

for(int i=Stol[stol]+1;i<Stol[stol-1];i++)

{

if(Cep[nomer][Str[str-1]][i]==4)

Cep[nomer][Str[str-1]][i]=12;//

else

Cep[nomer][Str[str-1]][i]=3;//

}

Cep[nomer][Str[str-1]][Stol[stol]]=9;//

}

else // 0' 0*

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=6;//

for(int i=Stol[stol]+1;i<Stol[stol-1];i++)

{

if(Cep[nomer][Str[str-1]][i]==4)

Cep[nomer][Str[str-1]][i]=12;//

else

Cep[nomer][Str[str-1]][i]=3;//

}

Cep[nomer][Str[str-1]][Stol[stol]]=9;

}

}

else // 0' 0*

{

if (Str[str-2]<Str[str-1])// 0' 0*

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=5;//

for(int i=Stol[stol-1]+1;i<Stol[stol];i++)

{

if(Cep[nomer][Str[str-1]][i]==4)

Cep[nomer][Str[str-1]][i]=12;//

else

Cep[nomer][Str[str-1]][i]=3;//

}

Cep[nomer][Str[str-1]][Stol[stol]]=1;

}

else // 0' 0*

{

Cep[nomer][Str[str-1]][Stol[stol-1]]=7;//

for(int i=Stol[stol-1]+1;i<Stol[stol];i++)

{

if(Cep[nomer][Str[str-1]][i]==4)

Cep[nomer][Str[str-1]][i]=12;//

else

Cep[nomer][Str[str-1]][i]=3;//

}

Cep[nomer][Str[str-1]][Stol[stol]]=1;

}

}

stol++;

Q[v]=D[Str[str-1]][j]-X[Str[str-1]][j];

v++;

break;

}

}

stroka=-1;

}

nomer++;

//

NewTab();

int min=Q[0];

for(int i=1;i<v;i++)

{

if(Q[i]<min)

min=Q[i];

}

str--;

stol--;

X[Str[str]][Stol[stol]]+=min;

P[Stol[stol]]-=min;

while(1)

{

if(str==0)

{

Z[Str[str]]-=min;

break;

}

stol--;

X[Str[str]][Stol[stol]]-=min;

str--;

X[Str[str]][Stol[stol]]+=min;

}

OPrz=0;

OPtr=0;

for(int i=0;i<Zn;i++)

OPrz+=Z[i];

for(int i=0;i<Pm;i++)

OPtr+=P[i];

delete []G;

G=NULL;

delete []F;

F=NULL;

delete []Q;

Q=NULL;

delete []Str;

Str=NULL;

delete []Stol;

Stol=NULL;

}

//!!!

MessageDlg(L" a.", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

//

Izderg->RowCount=Cn;

Izderg->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

switch (N[i][j])

{

case 4:

Izderg->Cells[j][i]="0*";

break;

case 3:

Izderg->Cells[j][i]="0'";

break;

case 2:

Izderg->Cells[j][i]=L'\u022a';

break;

case 1:

Izderg->Cells[j][i]=L'\u0230';

break;

case 0:

Izderg->Cells[j][i]="0";

case -1:

Izderg->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

break;

}

}

}

//

Plan->RowCount=Xn;

Plan->ColCount=Xm;

for(int i=0;i<Xn;i++)

{

for(int j=0;j<Xm;j++)

{

if(X[i][j]==0)

Plan->Cells[j][i]="";

else

Plan->Cells[j][i]=FormatFloat("",X[i][j]/100.0);

}

}

L=0;

Lstr="L=";

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

if(X[i][j]>0)

{

L+=X[i][j]*C0[i][j];

Lstr+=FormatFloat("",C0[i][j]/100.0)+"*"+FormatFloat("",X[i][j]/100.0)+"+";

}

}

}

Lstr.Delete(Lstr.Length(),1);

Lstr+="="+FormatFloat("",L/10000.0);

Edit2->Text=Lstr;

//

delete []C;

C=NULL;

delete []P;

P=NULL;

delete []Z;

Z=NULL;

delete []D;

D=NULL;

delete []X;

X=NULL;

delete []N;

N=NULL;

}__fastcall TForm1::NOpenClick(TObject *Sender)

{

if(OpenDialog1->Execute())

{

MyFName=OpenDialog1->FileName;

Open(OpenDialog1->FileName);

}

}

//---------------------------------------------------------------------------__fastcall TForm1::NSaveAsClick(TObject *Sender)

{

SaveDialog1->FileName=MyFName;

if(SaveDialog1->Execute())

{

MyFName=SaveDialog1->FileName;

Save(SaveDialog1->FileName);

}

}

//---------------------------------------------------------------------------__fastcall TForm1::NSaveClick(TObject *Sender)

{

if(MyFName!="")

Save(MyFName);

else

if(SaveDialog1->Execute())

{

MyFName=SaveDialog1->FileName;

Save(SaveDialog1->FileName);

}

}

//---------------------------------------------------------------------------__fastcall TForm1::NNewClick(TObject *Sender)

{

Zapas->RowCount=8;

for(int i=1;i<Zapas->RowCount;i++)

{

Zapas->Cells[0][i]="";

}

StoimPer->ColCount=8;

StoimPer->RowCount=8;

for(int i=1;i<StoimPer->RowCount;i++)

{

for(int j=1;j<StoimPer->ColCount;j++)

{

StoimPer->Cells[j][i]="";

}

}

Ogran->ColCount=8;

Ogran->RowCount=8;

Potr->ColCount=8;

for(int j=1;j<Potr->ColCount;j++)

{

Potr->Cells[j][0]="";

}

Edit2->Text="L=";

}

//---------------------------------------------------------------------------TForm1::Save(UnicodeString adr)

{

ofstream f(adr.t_str() ,ios::out);

for(int i=1;i<Zapas->RowCount;i++)

{

if(Zapas->Cells[0][i]=="")

{

f<<"0 ";

}

else

{

f<<Zapas->Cells[0][i].ToDouble()<<" ";

}

}

f<<"\n\n";

for(int i=1;i<StoimPer->RowCount;i++)

{

for(int j=1;j<StoimPer->ColCount;j++)

{

if(StoimPer->Cells[j][i]=="")

{

f<<"0 ";

}

else

{

f<<StoimPer->Cells[j][i].ToDouble()<<" ";

}

}

f<<"\n";

}

f<<"\n";

for(int i=0;i<Ogran->RowCount;i++)

{

for(int j=0;j<Ogran->ColCount;j++)

{

if(Ogran->Cells[j][i]=="")

{

f<<"0 ";

}

else

{

f<<Ogran->Cells[j][i].ToDouble()<<" ";

}

}

f<<"\n";

}

f<<"\n";

for(int i=1;i<Potr->ColCount;i++)

{

if(Potr->Cells[i][0]=="")

{

f<<"0 ";

}

else

{

f<<Potr->Cells[i][0].ToDouble()<<" ";

}

}

f.close();

}

//------------------------------------------------------------------------TForm1::Open(UnicodeString adr)

{

int k;

double d;

ifstream f(adr.t_str() ,ios::in|ios::nocreate);

f>>k;

//UDStrok->Position=k;

f>>k;

//UDStolb->Position=k;

//Zapas->RowCount=UDStrok->Position+1;

for(int i=1;i<Zapas->RowCount;i++)

{

f>>d;

Zapas->Cells[0][i]=FormatFloat("",d);

}

//StoimPer->RowCount=UDStrok->Position+1;

//StoimPer->ColCount=UDStolb->Position+1;

for(int i=1;i<StoimPer->RowCount;i++)

{

for(int j=1;j<StoimPer->ColCount;j++)

{

f>>d;

StoimPer->Cells[j][i]=FormatFloat("",d);

}

}

//Ogran->RowCount=UDStrok->Position;

//Ogran->ColCount=UDStolb->Position;

for(int i=0;i<Ogran->RowCount;i++)

{

for(int j=0;j<Ogran->ColCount;j++)

{

f>>d;

Ogran->Cells[j][i]=FormatFloat("",d);

}

}

//Potr->ColCount=UDStolb->Position+1;

for(int i=1;i<Potr->ColCount;i++)

{

f>>d;

Potr->Cells[i][0]=FormatFloat("",d);

}

f.close();

Edit2->Text="L=";

}TForm1::NewTab()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

GrX=new TStringGrid(this);

LabelC=new TLabel(this);

LabelX=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

NIter++;

Sheet->Caption=". "+IntToStr(NIter);

Sheet->Name="S"+IntToStr(NIter-1);

Grid->Parent=Sheet;

Grid->OnDrawCell=StoimPer->OnDrawCell;

Grid->Left=29;

Grid->Top=34;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

switch (N[i][j])

{

case 4:

Grid->Cells[j][i]="0*";

break;

case 3:

Grid->Cells[j][i]="0'";

break;

case 2:

Grid->Cells[j][i]=L'\u022a';

break;

case 1:

Grid->Cells[j][i]=L'\u0230';

break;

case 0:

Grid->Cells[j][i]="0";

case -1:

Grid->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

break;

}

}

}

LabelC->Parent=Sheet;

LabelC->Left=17;

LabelC->Top=18;

LabelC->Caption="C"+IntToStr(NIter);

GrX->Parent=Sheet;

GrX->Left=29;

GrX->Top=221;

GrX->Height=181;

GrX->Width=256;

GrX->DefaultColWidth=35;

GrX->DefaultRowHeight=24;

GrX->FixedCols=0;

GrX->FixedRows=0;

GrX->ScrollBars=ssNone;

GrX->RowCount=Cn;

GrX->ColCount=Cm;

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

if(X[i][j]!=0)

GrX->Cells[j][i]=FormatFloat("",X[i][j]/100.0);

LabelX->Parent=Sheet;

LabelX->Left=17;

LabelX->Top=200;

LabelX->Caption="X"+IntToStr(NIter);

TStringGrid *GridP=new TStringGrid(this);

GridP->Parent=Sheet;

GridP->Left=286;

GridP->Top=221;

GridP->Height=181;

GridP->Width=39;

GridP->ColCount=1;

GridP->DefaultColWidth=35;

GridP->DefaultRowHeight=24;

GridP->FixedCols=0;

GridP->FixedRows=0;

GridP->RowCount=Cn;

GridP->ScrollBars=ssNone;

for(int i=0;i<Cn;i++)

GridP->Cells[0][i]=FormatFloat("",Z[i]/100.0);

TStringGrid* GridB=new TStringGrid(this);

GridB->Parent=Sheet;

GridB->Left=30;

GridB->Top=405

;

GridB->Height=25;

GridB->Width=256;

GridB->ColCount=Cm;

GridB->DefaultColWidth=35;

GridB->DefaultRowHeight=24;

GridB->FixedCols=0;

GridB->FixedRows=0;

GridB->RowCount=1;

GridB->ScrollBars=ssNone;

for(int i=0;i<Cm;i++)

GridB->Cells[i][0]=FormatFloat("",P[i]/100.0);

GridF=new TStringGrid(this);

GridF->Parent=Sheet;

GridF->Left=286;

GridF->Top=34;

GridF->Height=181;

GridF->Width=16;

GridF->ColCount=1;

GridF->DefaultColWidth=12;

GridF->DefaultRowHeight=24;

GridF->FixedCols=0;

GridF->FixedRows=0;

GridF->RowCount=Cn;

GridF->ScrollBars=ssNone;

for(int i=0;i<Cn;i++)

if(F[i]==1)

GridF->Cells[0][i]="+";

TStringGrid *GridG=new TStringGrid(this);

GridG->Parent=Sheet;

GridG->Left=30;

GridG->Top=13;

GridG->Height=16;

GridG->Width=256;

GridG->ColCount=Cm;

GridG->DefaultColWidth=35;

GridG->DefaultRowHeight=12;

GridG->FixedCols=0;

GridG->FixedRows=0;

GridG->RowCount=1;

GridG->ScrollBars=ssNone;

for(int i=0;i<Cm;i++)

if(G[i]==1)

GridG->Cells[i][0]="+";

}TForm1::Predv()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

GrX=new TStringGrid(this);

LabelC=new TLabel(this);

LabelX=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

Sheet->Caption=". ";

Grid->Parent=Sheet;

Grid->Left=30;

Grid->Top=39;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

Grid->Cells[j][i]=FormatFloat("",CS[i][j]/100.0);

}

}

LabelC->Parent=Sheet;

LabelC->Left=3;

LabelC->Top=20;

LabelC->Caption="C'";

GrX->Parent=Sheet;

GrX->Left=30;

GrX->Top=239;

GrX->Height=181;

GrX->Width=256;

GrX->DefaultColWidth=35;

GrX->DefaultRowHeight=24;

GrX->FixedCols=0;

GrX->FixedRows=0;

GrX->ScrollBars=ssNone;

GrX->RowCount=Cn;

GrX->ColCount=Cm;

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

GrX->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

LabelX->Parent=Sheet;

LabelX->Left=3;

LabelX->Top=223;

LabelX->Caption="C0";

}TForm1::Ecviv()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

LabelC=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

NKor++;

Sheet->Caption=". . "+IntToStr(NIter+1)+"."+IntToStr(NKor);

Grid->Parent=Sheet;

Grid->Left=30;

Grid->Top=39;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

switch (N[i][j])

{

case 4:

Grid->Cells[j][i]="0*";

break;

case 3:

Grid->Cells[j][i]="0'";

break;

case 2:

Grid->Cells[j][i]=L'\u022a';

break;

case 1:

Grid->Cells[j][i]=L'\u0230';

break;

case 0:

Grid->Cells[j][i]="0";

case -1:

Grid->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

break;

}

}

}

LabelC->Parent=Sheet;

LabelC->Left=3;

LabelC->Top=20;

LabelC->Caption="C"+IntToStr(NKor);

}__fastcall TForm1::CepochDrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,

TGridDrawState State)

{

TStringGrid* c=(TStringGrid*) Sender;

if (c->Name!="StoimPer")

{

UnicodeString Index;

Index=PageControl->ActivePage->Name;

Index.Delete(1,1);

nomer=Index.ToInt();

Graphics::TBitmap *pict = new Graphics::TBitmap();

switch (Cep[nomer][ARow][ACol])

{

case 12:

pict->LoadFromResourceID((unsigned int)HInstance,104);

break;

case 9:

pict->LoadFromResourceID((unsigned int)HInstance,102);

break;

case 7:

pict->LoadFromResourceID((unsigned int)HInstance,106);

break;

case 6:

pict->LoadFromResourceID((unsigned int)HInstance,105);

break;

case 5:

pict->LoadFromResourceID((unsigned int)HInstance,108);

break;

case 4:

pict->LoadFromResourceID((unsigned int)HInstance,109);

break;

case 3:

pict->LoadFromResourceID((unsigned int)HInstance,101);

break;

case 2:

pict->LoadFromResourceID((unsigned int)HInstance,107);

break;

case 1:

pict->LoadFromResourceID((unsigned int)HInstance,103);

break;

}

pict->Transparent = true;

c->Canvas->Draw(Rect.left,Rect.Top,pict);

pict->Free();

}

nomer=0;

}

//---------------------------------------------------------------------------

//!!__fastcall TForm1::Timer1Timer(TObject *Sender)

{(StoimPer->ColCount == 8)

Button1->Enabled = false;Button1->Enabled = true;(StoimPer->ColCount == 4)

Button2->Enabled = false;Button2->Enabled = true;(StoimPer->RowCount == 8)

Button3->Enabled = false;Button3->Enabled = true;(StoimPer->RowCount == 4)

Button4->Enabled = false;Button4->Enabled = true;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button1Click(TObject *Sender)

{>ColCount++;>ColCount++;>ColCount++;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button2Click(TObject *Sender)

{>ColCount--;>ColCount--;>ColCount--;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button3Click(TObject *Sender)

{>RowCount++;>RowCount++;>RowCount++;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button4Click(TObject *Sender)

{>RowCount--;>RowCount--;>RowCount--;

}

//---------------------------------------------------------------------------__fastcall TForm1::NAboutClick(TObject *Sender)

{(L" -23 .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

}

//---------------------------------------------------------------------------


Open(UnicodeString adr)

{

int k;

double d;

ifstream f(adr.t_str() ,ios::in|ios::nocreate);

f>>k;

//UDStrok->Position=k;

f>>k;

//UDStolb->Position=k;

//Zapas->RowCount=UDStrok->Position+1;

for(int i=1;i<Zapas->RowCount;i++)

{

f>>d;

Zapas->Cells[0][i]=FormatFloat("",d);

}

//StoimPer->RowCount=UDStrok->Position+1;

//StoimPer->ColCount=UDStolb->Position+1;

for(int i=1;i<StoimPer->RowCount;i++)

{

for(int j=1;j<StoimPer->ColCount;j++)

{

f>>d;

StoimPer->Cells[j][i]=FormatFloat("",d);

}

}

//Ogran->RowCount=UDStrok->Position;

//Ogran->ColCount=UDStolb->Position;

for(int i=0;i<Ogran->RowCount;i++)

{

for(int j=0;j<Ogran->ColCount;j++)

{

f>>d;

Ogran->Cells[j][i]=FormatFloat("",d);

}

}

//Potr->ColCount=UDStolb->Position+1;

for(int i=1;i<Potr->ColCount;i++)

{

f>>d;

Potr->Cells[i][0]=FormatFloat("",d);

}

f.close();

Edit2->Text="L=";

}TForm1::NewTab()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

GrX=new TStringGrid(this);

LabelC=new TLabel(this);

LabelX=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

NIter++;

Sheet->Caption=". "+IntToStr(NIter);

Sheet->Name="S"+IntToStr(NIter-1);

Grid->Parent=Sheet;

Grid->OnDrawCell=StoimPer->OnDrawCell;

Grid->Left=29;

Grid->Top=34;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

switch (N[i][j])

{

case 4:

Grid->Cells[j][i]="0*";

break;

case 3:

Grid->Cells[j][i]="0'";

break;

case 2:

Grid->Cells[j][i]=L'\u022a';

break;

case 1:

Grid->Cells[j][i]=L'\u0230';

break;

case 0:

Grid->Cells[j][i]="0";

case -1:

Grid->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

break;

}

}

}

LabelC->Parent=Sheet;

LabelC->Left=17;

LabelC->Top=18;

LabelC->Caption="C"+IntToStr(NIter);

GrX->Parent=Sheet;

GrX->Left=29;

GrX->Top=221;

GrX->Height=181;

GrX->Width=256;

GrX->DefaultColWidth=35;

GrX->DefaultRowHeight=24;

GrX->FixedCols=0;

GrX->FixedRows=0;

GrX->ScrollBars=ssNone;

GrX->RowCount=Cn;

GrX->ColCount=Cm;

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

if(X[i][j]!=0)

GrX->Cells[j][i]=FormatFloat("",X[i][j]/100.0);

LabelX->Parent=Sheet;

LabelX->Left=17;

LabelX->Top=200;

LabelX->Caption="X"+IntToStr(NIter);

TStringGrid *GridP=new TStringGrid(this);

GridP->Parent=Sheet;

GridP->Left=286;

GridP->Top=221;

GridP->Height=181;

GridP->Width=39;

GridP->ColCount=1;

GridP->DefaultColWidth=35;

GridP->DefaultRowHeight=24;

GridP->FixedCols=0;

GridP->FixedRows=0;

GridP->RowCount=Cn;

GridP->ScrollBars=ssNone;

for(int i=0;i<Cn;i++)

GridP->Cells[0][i]=FormatFloat("",Z[i]/100.0);

TStringGrid* GridB=new TStringGrid(this);

GridB->Parent=Sheet;

GridB->Left=30;

GridB->Top=405

;

GridB->Height=25;

GridB->Width=256;

GridB->ColCount=Cm;

GridB->DefaultColWidth=35;

GridB->DefaultRowHeight=24;

GridB->FixedCols=0;

GridB->FixedRows=0;

GridB->RowCount=1;

GridB->ScrollBars=ssNone;

for(int i=0;i<Cm;i++)

GridB->Cells[i][0]=FormatFloat("",P[i]/100.0);

GridF=new TStringGrid(this);

GridF->Parent=Sheet;

GridF->Left=286;

GridF->Top=34;

GridF->Height=181;

GridF->Width=16;

GridF->ColCount=1;

GridF->DefaultColWidth=12;

GridF->DefaultRowHeight=24;

GridF->FixedCols=0;

GridF->FixedRows=0;

GridF->RowCount=Cn;

GridF->ScrollBars=ssNone;

for(int i=0;i<Cn;i++)

if(F[i]==1)

GridF->Cells[0][i]="+";

TStringGrid *GridG=new TStringGrid(this);

GridG->Parent=Sheet;

GridG->Left=30;

GridG->Top=13;

GridG->Height=16;

GridG->Width=256;

GridG->ColCount=Cm;

GridG->DefaultColWidth=35;

GridG->DefaultRowHeight=12;

GridG->FixedCols=0;

GridG->FixedRows=0;

GridG->RowCount=1;

GridG->ScrollBars=ssNone;

for(int i=0;i<Cm;i++)

if(G[i]==1)

GridG->Cells[i][0]="+";

}TForm1::Predv()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

GrX=new TStringGrid(this);

LabelC=new TLabel(this);

LabelX=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

Sheet->Caption=". ";

Grid->Parent=Sheet;

Grid->Left=30;

Grid->Top=39;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

Grid->Cells[j][i]=FormatFloat("",CS[i][j]/100.0);

}

}

LabelC->Parent=Sheet;

LabelC->Left=3;

LabelC->Top=20;

LabelC->Caption="C'";

GrX->Parent=Sheet;

GrX->Left=30;

GrX->Top=239;

GrX->Height=181;

GrX->Width=256;

GrX->DefaultColWidth=35;

GrX->DefaultRowHeight=24;

GrX->FixedCols=0;

GrX->FixedRows=0;

GrX->ScrollBars=ssNone;

GrX->RowCount=Cn;

GrX->ColCount=Cm;

for(int i=0;i<Cn;i++)

for(int j=0;j<Cm;j++)

GrX->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

LabelX->Parent=Sheet;

LabelX->Left=3;

LabelX->Top=223;

LabelX->Caption="C0";

}TForm1::Ecviv()

{

Sheet=new TTabSheet(this);

Grid=new TStringGrid(this);

LabelC=new TLabel(this);

Sheet->Parent=this;

Sheet->PageControl=PageControl;

NKor++;

Sheet->Caption=". . "+IntToStr(NIter+1)+"."+IntToStr(NKor);

Grid->Parent=Sheet;

Grid->Left=30;

Grid->Top=39;

Grid->Height=181;

Grid->Width=256;

Grid->DefaultColWidth=35;

Grid->DefaultRowHeight=24;

Grid->FixedCols=0;

Grid->FixedRows=0;

Grid->ScrollBars=ssNone;

Grid->RowCount=Cn;

Grid->ColCount=Cm;

for(int i=0;i<Cn;i++)

{

for(int j=0;j<Cm;j++)

{

switch (N[i][j])

{

case 4:

Grid->Cells[j][i]="0*";

break;

case 3:

Grid->Cells[j][i]="0'";

break;

case 2:

Grid->Cells[j][i]=L'\u022a';

break;

case 1:

Grid->Cells[j][i]=L'\u0230';

break;

case 0:

Grid->Cells[j][i]="0";

case -1:

Grid->Cells[j][i]=FormatFloat("",C[i][j]/100.0);

break;

}

}

}

LabelC->Parent=Sheet;

LabelC->Left=3;

LabelC->Top=20;

LabelC->Caption="C"+IntToStr(NKor);

}__fastcall TForm1::CepochDrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,

TGridDrawState State)

{

TStringGrid* c=(TStringGrid*) Sender;

if (c->Name!="StoimPer")

{

UnicodeString Index;

Index=PageControl->ActivePage->Name;

Index.Delete(1,1);

nomer=Index.ToInt();

Graphics::TBitmap *pict = new Graphics::TBitmap();

switch (Cep[nomer][ARow][ACol])

{

case 12:

pict->LoadFromResourceID((unsigned int)HInstance,104);

break;

case 9:

pict->LoadFromResourceID((unsigned int)HInstance,102);

break;

case 7:

pict->LoadFromResourceID((unsigned int)HInstance,106);

break;

case 6:

pict->LoadFromResourceID((unsigned int)HInstance,105);

break;

case 5:

pict->LoadFromResourceID((unsigned int)HInstance,108);

break;

case 4:

pict->LoadFromResourceID((unsigned int)HInstance,109);

break;

case 3:

pict->LoadFromResourceID((unsigned int)HInstance,101);

break;

case 2:

pict->LoadFromResourceID((unsigned int)HInstance,107);

break;

case 1:

pict->LoadFromResourceID((unsigned int)HInstance,103);

break;

}

pict->Transparent = true;

c->Canvas->Draw(Rect.left,Rect.Top,pict);

pict->Free();

}

nomer=0;

}

//---------------------------------------------------------------------------

//!!__fastcall TForm1::Timer1Timer(TObject *Sender)

{(StoimPer->ColCount == 8)

Button1->Enabled = false;Button1->Enabled = true;(StoimPer->ColCount == 4)

Button2->Enabled = false;Button2->Enabled = true;(StoimPer->RowCount == 8)

Button3->Enabled = false;Button3->Enabled = true;(StoimPer->RowCount == 4)

Button4->Enabled = false;Button4->Enabled = true;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button1Click(TObject *Sender)

{>ColCount++;>ColCount++;>ColCount++;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button2Click(TObject *Sender)

{>ColCount--;>ColCount--;>ColCount--;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button3Click(TObject *Sender)

{>RowCount++;>RowCount++;>RowCount++;

}

//---------------------------------------------------------------------------__fastcall TForm1::Button4Click(TObject *Sender)

{>RowCount--;>RowCount--;>RowCount--;

}

//---------------------------------------------------------------------------__fastcall TForm1::NAboutClick(TObject *Sender)

{(L" -23 .", mtConfirmation,

TMsgDlgButtons() << mbOK, 0);

}

//---------------------------------------------------------------------------