Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "Unit1.h"
  7. #include "math.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TForm1 *Form1;
  12. //---------------------------------------------------------------------------
  13. __fastcall TForm1::TForm1(TComponent* Owner)
  14. : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18.  
  19. void __fastcall TForm1::FormCreate(TObject *Sender)
  20. {
  21. Edit1->Text="182,5";
  22. Edit2->Text="18,225";
  23. Edit3->Text="-0,03298";
  24. Memo1->Clear();
  25. Memo1->Lines->Add("942791 Belko ");
  26. }
  27. //---------------------------------------------------------------------------
  28.  
  29. void __fastcall TForm1::Button1Click(TObject *Sender)
  30. {
  31. double x,y,z;
  32. x=StrToFloat(Edit1->Text);
  33. Memo1->Lines->Add("x="+Edit1->Text);
  34. y=StrToFloat(Edit2->Text);
  35. Memo1->Lines->Add("y="+Edit2->Text);
  36. z=StrToFloat(Edit3->Text);
  37. Memo1->Lines->Add("z="+Edit3->Text);
  38. double a=fabs(pow(x,y/x)-pow(y/x,1./3.))+(y-x)*(cos(y)-z/(y-x))/(1+pow(y-x,2));
  39. Memo1->Lines->Add("P = " + FloatToStrF(a,ffFixed,8,4));
  40. }
  41. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement