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

#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::Button2Click(TObject *Sender)
{
 Memo1->Clear();
 Edit1->Clear();
 Edit2->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
 Memo1->Clear();
 Edit1->Clear();
 Edit2->Clear();
 RadioGroup1->ItemIndex = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 float x,y;
 float a,b;
 x=StrToFloat(Edit1->Text);
 y=StrToFloat(Edit2->Text);

 switch(RadioGroup1->ItemIndex)
 {
  case 0: a=(sin(x)+cos(y))/(cos(x)-sin(y))*(tan(x*y));
          Memo1->Lines->Add("A="+FloatToStrF(a, ffFixed, 7,3));
          break;
  case 1: b=((x+y)/(y+1))-((x*y-12)/(34+x));
          Memo1->Lines->Add("B="+FloatToStrF(b, ffFixed, 7,3));
          break;
  }
}
//---------------------------------------------------------------------------


Соседние файлы в папке приклад 3-4
  • #
    30.05.20203.89 Кб1Project1.bpr
  • #
    30.05.20201.07 Кб0Project1.cpp
  • #
    30.05.2020422.96 Кб0Project1.obj
  • #
    30.05.2020876 б0Project1.res
  • #
    30.05.2020655.36 Кб0Project1.tds
  • #
    30.05.20201.5 Кб0Unit1.cpp
  • #
    30.05.202051 б0Unit1.ddp
  • #
    30.05.20201.95 Кб0Unit1.dfm
  • #
    30.05.20201.15 Кб0Unit1.h
  • #
    30.05.2020471.93 Кб0Unit1.obj
  • #
    30.05.20201.5 Кб0Unit1.~cpp