Расчетно-графическая работа по программированию
Реферат - Компьютеры, программирование
Другие рефераты по предмету Компьютеры, программирование
]="";
sg3->Cells[j][i]=IntToStr(res.matr[i][j].cel)+"*"+"> Resform->sg3->Cells[j][i]=IntToStr(res.matr[i][j].cel)+"*"+
IntToStr(res.matr[i][j].chisl)+
"/"+IntToStr(res.matr[i][j].znamen);
}
Resform->ShowModal();
}
else MessageBox (NULL,"Ну кто так складывает","ЧАЙНИК!!",MB_ICONEXCLAMATION );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::C1Click(TObject *Sender)
{
for (int i=0; iRowCount; i++)
for (int j=0; jColCount; j++)
sg1->Cells[j][i]=IntToStr(1+random(6))+
"/"+IntToStr(1+random(6));
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::C2Click(TObject *Sender)
{
for (int i=0; iRowCount; i++)
for (int j=0; jColCount; j++)
sg2->Cells[j][i]=IntToStr(1+random(6))+
"/"+IntToStr(1+random(6));
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::Btn4Click(TObject *Sender)
{
Analisation ob,ob1;
matrix first (n,m);
matrix second (k,l);
first.Read(sg1,ob);
second.Read(sg2,ob1);
if (first.Getx()==second.Getx() &&
first.Gety()==second.Gety())
{
matrix res=first-second;
sg3->RowCount=res.Getx();"> Resform->sg3->RowCount=res.Getx();
sg3->ColCount=res.Gety();"> Resform->sg3->ColCount=res.Gety();
for (int i=0; i<res.Getx(); i++)
for (int j=0; j<res.Gety(); j++)
res.matr[i][j].videlen();
for (int i=0; i<res.Getx(); i++)
for (int j=0; j<res.Gety(); j++)
{
Resform->sg3->Cells[j][i]="";
sg3->Cells[j][i]=IntToStr(res.matr[i][j].cel)+"*"+"> Resform->sg3->Cells[j][i]=IntToStr(res.matr[i][j].cel)+"*"+
IntToStr(res.matr[i][j].chisl)+
"/"+IntToStr(res.matr[i][j].znamen);
}
Resform->ShowModal();
}
else MessageBox (NULL,"Ну кто так отнимает","ЧАЙНИК!!",MB_ICONEXCLAMATION );
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N1Click(TObject *Sender)
{
for (int i=0; iRowCount; i++)
for (int j=0; jColCount; j++)
sg1->Cells[j][i]="";
Panel1->Caption="";
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N2Click(TObject *Sender)
{
for (int i=0; iRowCount; i++)
for (int j=0; jColCount; j++)
sg2->Cells[j][i]="";
Panel2->Caption="";
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::Btn5Click(TObject *Sender)
{
Nunit->ShowModal();
Analisation ob,ob1,ob2;
Edit->Text.c_str());"> chislo=ob.MAIN(Nunit->Edit->Text.c_str());
matrix first (n,m);
matrix second (k,l);
first.Read(sg1,ob1);
second.Read(sg2,ob2);
matrix res1 (first.Getx(), first.Gety());
matrix res2 (second.Getx(), second.Gety());
if (Nunit->RBtn1->Checked)
{
res1=first.operator *(chislo);
for (int i=0; i<res1.Getx(); i++)
for (int j=0; j<res1.Gety(); j++)
res1.matr[i][j].videlen();
sg3->RowCount=res1.Getx();"> Resform->sg3->RowCount=res1.Getx();
sg3->ColCount=res1.Gety();"> Resform->sg3->ColCount=res1.Gety();
for (int i=0; i<res1.Getx(); i++)
for (int j=0; j<res1.Gety(); j++)
{
Resform->sg3->Cells[j][i]="";
sg3->Cells[j][i]=IntToStr(res1.matr[i][j].cel)+"> Resform->sg3->Cells[j][i]=IntToStr(res1.matr[i][j].cel)+
"*"+IntToStr(res1.matr[i][j].chisl)+"/"+
IntToStr(res1.matr[i][j].znamen);
}
Resform->Box1->Visible=true;
Resform->ShowModal();
}
if (Nunit->RBtn2->Checked)
{
Edit->Text.ToInt());"> res1=first.operator *(Nunit->Edit->Text.ToInt());
for (int i=0; i<res1.Getx(); i++)
for (int j=0; j<res1.Gety(); j++)
res1.matr[i][j].videlen();
sg3->RowCount=res1.Getx();"> Resform->sg3->RowCount=res1.Getx();
sg3->ColCount=res1.Gety();"> Resform->sg3->ColCount=res1.Gety();
for (int i=0; i<res1.Getx(); i++)
for (int j=0; j<res1.Gety(); j++)
{
Resform->sg3->Cells[j][i]="";
sg3->Cells[j][i]=IntToStr(res1.matr[i][j].cel)+"> Resform->sg3->Cells[j][i]=IntToStr(res1.matr[i][j].cel)+
"*"+IntToStr(res1.matr[i][j].chisl)+"/"+
IntToStr(res1.matr[i][j].znamen);
}
Resform->Box1->Visible=true;
Resform->ShowModal();
}
if (Resform->Box1->Checked)
{
if (Nunit->RBtn1->Checked)
{
res2=second.operator *(chislo);
for (int i=0; i<res2.Getx(); i++)
for (int j=0; j<res2.Gety(); j++)
res2.matr[i][j].videlen();
sg3->RowCount=res2.Getx();"> Resform->sg3->RowCount=res2.Getx();
sg3->ColCount=res2.Gety();"> Resform->sg3->ColCount=res2.Gety();
for (int i=0; i<res2.Getx(); i++)
for (int j=0; j<res2.Gety(); j++)
{
Resform->sg3->Cells[j][i]="";
sg3->Cells[j][i]=IntToStr(res2.matr[i][j].cel)+"> Resform->sg3->Cells[j][i]=IntToStr(res2.matr[i][j].cel)+
"*"+IntToStr(res2.matr[i][j].chisl)+"/"+
IntToStr(res2.matr[i][j].znamen);
}
Resform->Box1->Visible=false;
Resform->ShowModal();
}
if (Nunit->RBtn2->Checked)
{
Edit->Text.ToInt());"> res2=second.operator *(Nunit->Edit->Text.ToInt());
for (int i=0; i<res2.Getx(); i++)
for (int j=0; j<res2.Gety(); j++)
res2.matr[i][j].videlen();
sg3->RowCount=res2.Getx();"> Resform->sg3->RowCount=res2.Getx();
sg3->ColCount=res2.Gety();"> Resform->sg3->ColCount=res2.Gety();
for (int i=0; i<res2.Getx(); i++)
for (int j=0; j<res2.Gety(); j++)
{
Resform->sg3->Cells[j][i]="";
sg3->Cells[j][i]=IntToStr(res2.matr[i][j].cel)+"> Resform->sg3->Cells[j][i]=IntToStr(res2.matr[i][j].cel)+
"*"+IntToStr(res2.matr[i][j].chisl)+"/"+
IntToStr(res2.matr[i][j].znamen);
}
Resform->Box1->Visible=false;
Resform->ShowModal();
}
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::Btn6Click(TObject *Sender)
{
Analisation ob1,ob2;
matrix first (n,m);
matrix second (k,l);
first.Read(sg1,ob1);
second.Read(sg2,ob2);
drob temp1,temp2;
temp1=first.Determinant();
temp2=second.Determinant();
Panel1->Caption="Определитель первой: "+
IntToStr(temp1.cel)+"*"+IntToStr(temp1.chisl)+"/"
+IntToStr(temp1.znamen);
Panel2->Caption="Определитель второй: "+
IntToStr(temp2.cel)+"*"+IntToStr(temp2.chisl)+"/"
+IntToStr(temp2.znamen);
}