Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
PZ_DP_2012_chast_2.docx
Скачиваний:
3
Добавлен:
26.09.2019
Размер:
302.12 Кб
Скачать

If (b) then

begin

New:=True;

Delete(S, i-1, 1);

Delete(S, j, 1);

Break;

end;

//Insert('-1*', S, i);

//New:=True;

end;

If(New)then

Break;

end;

end;

Preobr:=S;

//mmo2.Lines.Add(BackStr);

end;

function TForm1.isNumber(c: Char): boolean;

begin

if(((ord(c) >= 48)and(ord(c) <= 57))or(ord(c) = 46))then //,0123456789

isNumber := True

else

isNumber := False;

end;

function TForm1.isPMUR(c: Char): boolean;

begin

case ord(c) of

43 : isPMUR := True;

45 : isPMUR := True;

42 : isPMUR := True;

47 : isPMUR := True;

else

isPMUR := False;

end;

end;

function TForm1.isPM(c: Char): boolean;

begin

case ord(c) of

43 : isPM := True;

45 : isPM := True;

else

isPM := False;

end;

end;

function TForm1.isUR(c: Char): boolean;

begin

case ord(c) of

42 : isUR := True;

47 : isUR := True;

else

isUR := False;

end;

end;

function TForm1.isSC(c: Char): boolean;

begin

case ord(c) of

40 : isSC := True;

41 : isSC := True;

else

isSC := False;

end;

end;

procedure TForm1.btn1Click(Sender: TObject);

var

I,a,k,t:Integer;

j,res,bottom,y0:Real;

f1,f2,f1dx,f1dy,f2dx,f2dy:string;

begin

bottom:=0;

y0:=StrToFloat(edt4.Text);

for k:=1 to SG.ColCount-1 do

begin

res:=1;

for i:=1 to SG.ColCount-1 do

begin

if i<>k then

begin

res:=(res*(y0-StrToFloat(SG.Cells[i,1])))/(StrToFloat(SG.Cells[k,1])-StrToFloat(SG.Cells[i,1]));

//res:=StrToFloat(SG.Cells[i,1]);

//mmo2.Lines.Add(FloatToStr(res));

end;

end;

res:=res*StrToFloat(SG.Cells[k,0]);

//mmo2.Lines.Add(FloatToStr(res));

bottom:=bottom+res;

end;

mmo2.Lines.Add(FloatToStr(bottom));

end;

procedure TForm1.btn2Click(Sender: TObject);

begin

SG.ColCount:=SG.ColCount+1;

end;

procedure TForm1.btn3Click(Sender: TObject);

begin

if(SG.ColCount>3)then

SG.ColCount:=SG.ColCount-1;

end;

end.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]