Скачиваний:
1
Добавлен:
30.05.2020
Размер:
2.58 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include<math.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
 Memo1->Clear();
 Edit1->Clear();
 Edit2->Clear();
 Edit3->Clear();
 Edit4->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)
{
 Memo1->Clear();
 Edit1->Clear();
 Edit2->Clear();
 Edit3->Clear();
 Edit4->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 float A,B,C;
 float a,b,g,r;
 a=StrToFloat(Edit3->Text);
 b=StrToFloat(Edit2->Text);
 g=StrToFloat(Edit1->Text);
 r=StrToFloat(Edit1->Text);
 A=2*r*sin(a*3.14/180);
 B=2*r*sin(b*3.14/180);
 C=2*r*sin(g*3.14/180);
 Memo1->Lines->Add("Cторона А="+FloatToStrF(A, ffFixed, 7,3));
 Memo1->Lines->Add("Cторона B="+FloatToStrF(B, ffFixed, 7,3));
 Memo1->Lines->Add("Cторона C="+FloatToStrF(C, ffFixed, 7,3));
 }
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit3KeyPress(TObject *Sender, char &Key)
{
 if ((Key >= '0') && (Key <= '9')) {}
 else if ((Key == 8) || (Key == ',')){}
 else Key = 0;       
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit2KeyPress(TObject *Sender, char &Key)
{
 if ((Key >= '0') && (Key <= '9')) {}
 else if ((Key == 8) || (Key == ',')){}
 else Key = 0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
{
 if ((Key >= '0') && (Key <= '9')) {}
 else if ((Key == 8) || (Key == ',')){}
 else Key = 0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit4KeyPress(TObject *Sender, char &Key)
{
 if ((Key >= '0') && (Key <= '9')) {}
 else if ((Key == 8) || (Key == ',')){}
 else Key = 0;
}
//---------------------------------------------------------------------------

Соседние файлы в папке PR_2_3
  • #
    30.05.20203.73 Кб1Project1.bpr
  • #
    30.05.20201.07 Кб1Project1.cpp
  • #
    30.05.202017.75 Кб1Project1.obj
  • #
    30.05.2020876 б1Project1.res
  • #
    30.05.20202.03 Mб2Project1.tds
  • #
    30.05.20202.58 Кб1Unit1.cpp
  • #
    30.05.202051 б1Unit1.ddp
  • #
    30.05.20203.41 Кб1Unit1.dfm
  • #
    30.05.20201.46 Кб2Unit1.h
  • #
    30.05.202043.92 Кб1Unit1.obj
  • #
    30.05.20202.58 Кб3Unit1.~cpp