
18.06.2010, 17:51
|
Местный
|
|
Регистрация: 31.05.2010
Адрес: Москва
Сообщения: 466
Версия Delphi: 7
Репутация: 40
|
|
может так?
Цитата:
Сообщение от NAZE
подскажите в чем ошибка:
procedure TForm1.Button1Click(Sender: TObject);
var
s,a,h,x,y,b:extended;
begin
y:=strtofloat(edit1.Text);
x:=strtofloat(edit2.Text);
if y=a then begin
x:=a;
s:=sqrt(3)/4*a*a;
h:=sqrt(a-(a/2));
end;
if y=s then begin
x:=s;
a:=sqrt(3)/4/s/s;
h:=sqrt(a-(a/2));
end;
if y=h then begin
x:=s;
a:=sqrt(3)/4/s/s;
s:=sqrt(3)/4*a*a;
end;
memo1.Lines.add('h='+floattostrf(h,fffixed,8,3)+' a='+floattostrf(a,fffixed,8,3)+' s='+floattostrf(s,fffixed,8,3));
end;
|
|