Алгоритмы поиска кратчайших покрытий булевых матриц
Курсовой проект - Компьютеры, программирование
Другие курсовые по предмету Компьютеры, программирование
/p>
Image2->Canvas->MoveTo(j*Image2->Width/a, 0);
Image2->Canvas->LineTo(j*Image2->Width/a, Image2->Height);
}
//Image2->Canvas->Brush->Color=clActiveCaption;
for(int i=0;i<q;i++)
{
for(int j=0;j<a;j++)
{
if(pokr2[i][j]==1)
{
Image2->Canvas->Brush->Color=clActiveCaption;
wert2++;
}
else
Image2->Canvas->Brush->Color=clWhite;
Image2->Canvas->FillRect(Rect(10*j+1,10*i+1,10*j+10,10*i+10));
}
}
Label6->Caption=IntToStr(wert2) ;
wert2 = 0;
}
delete []pokr;
delete []pokr2;
}
//---------------------------------------------------------------------------
void __fastcall TForm3::N3Click(TObject *Sender)
{
Form2->Visible=false;
Form3->Visible=false;
Form1->Visible=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm3::N2Click(TObject *Sender)
{
Form3->Visible=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm3::N1Click(TObject *Sender)
{
Form1->Show();
}
//---------------------------------------------------------------------------
Unit4.cpp
#include
#pragma hdrstop
#include "Unit5.h"
#include "Unit4.h"
#include "Unit3.h"
#include "Unit2.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
extern int b, a, q, **pokr,**pokr2 ,**arr,Flag;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm4::FormShow(TObject *Sender)
{
Image1->Width=10*q;
Image1->Height=10*b;
for(int i=0; i<b; i++)
{
Image1->Canvas->MoveTo(0, i*Image1->Height/b);
Image1->Canvas->LineTo(Image1->Width, i*Image1->Height/b);
}
for(int j=0; j<q; j++)
{
Image1->Canvas->MoveTo(j*Image1->Width/q, 0);
Image1->Canvas->LineTo(j*Image1->Width/q, Image1->Height);
}
Image1->Canvas->Brush->Color=clActiveCaption;
for(int i=0;i<q;i++)
{
for(int j=0;j<b;j++)
{
if(pokr[i][j]==1)
Image1->Canvas->FillRect(Rect(10*i+1,10*j+1,10*i+10,10*j+10));
} }
delete []pokr;
}
Unit5.cpp
#include
#pragma hdrstop
#include "Unit5.h"
#include "Unit4.h"
#include "Unit3.h"
#include "Unit2.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm5::Button1Click(TObject *Sender)
{
Form1->Show();
Form5->Close();
}