Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лаба 7 вар 9 / 2 / Unit1

.pas
Скачиваний:
14
Добавлен:
18.07.2019
Размер:
886 б
Скачать
☆
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Math;

type
  TForm1 = class(TForm)
    LabeledEdit1: TLabeledEdit;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var x, a, s, t:real;
var k:byte;
const n=12;
const k1=2;
begin
  x:=StrToFloat(LabeledEdit1.Text);
  a:=1; k:=2; s:=1; t:=0;
  for k:=2 to n do
    begin
      a:=1-Power((x/(k*3.14)),2);
      t:=t+1;
      s:=s*a;
    end;
  Label1.Caption:='S='+FloatToStrF(s, ffFixed, 10, 5);
  Label2.Caption:='слагаемых в сумме '+FloatToStr(t);
end;

end.
Соседние файлы в папке 2
  • #
    18.07.2019188 б14Project1.dpr
  • #
    18.07.2019876 б14Project1.res
  • #
    18.07.20195 Кб14Unit1.dcu
  • #
    18.07.201951 б14Unit1.ddp
  • #
    18.07.20191 Кб14Unit1.dfm
  • #
    18.07.2019886 б14Unit1.pas