//-------------------------------------------------------------------
#include
#include
#pragma hdrstop
#include “Unit15.h”
//-------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource “*.dfm”
Tform1 *Form1;
//-------------------------------------------------------------------
__fastcall Tform1::Tform1(Tcomponent* Owner)
: Tform(Owner)
{
}
//-------------------------------------------------------------------
void __fastcall Tform1::Button1Click(Tobject *Sender)
{ float m,r,y;
r = StrToFloat(Edit1->Text);
m= StrToFloat(Edit2->Text);
if r>=m+1
{ RadioGroup1->ItemIndex = 0;
y=(4*r+3*sqr(m))/(r-m);
label3->Caption=(“y=”+floattostr(y))
}
if r
{ RadioGroup1->ItemIndex =1;
y=abs(r-m);
label3->Caption=(“y=”+floattostr(y))
}
}
Natijada
Do'stlaringiz bilan baham: |