ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² написании студСнчСских Ρ€Π°Π±ΠΎΡ‚
АнтистрСссовый сСрвис

Листинг ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. 
ΠœΠ΅Ρ‚ΠΎΠ΄Ρ‹ ΠœΠΎΠ½Ρ‚Π΅-ΠšΠ°Ρ€Π»ΠΎ ΠΈ ΠΈΡ… использованиС Π² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ

Π Π΅Ρ„Π΅Ρ€Π°Ρ‚ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠΈΠ£Π·Π½Π°Ρ‚ΡŒ ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒΠΌΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Ρ‹

ΠΠ°Ρ‡Π°Π»ΡŒΠ½Ρ‹Π΅ ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ Ρ‚ΠΎΡ‡ΠΊΠΈ. Procedure TForm3. PaintBox1Paint (Sender: TObject); Panel1. Caption:='ΠŸΠ»ΠΎΡ‰Π°Π΄ΡŒ Ρ„ΠΈΠ³ΡƒΡ€Ρ‹ = '+S; Memo1.Lines.Add (FloatToStrF (r/100,ffFixed, 6,2)); Dialogs, StdCtrls, ExtCtrls, Math, Buttons, Menus; Dialogs, Math, StdCtrls, ExtCtrls, Buttons, Menus; Dialogs, ExtCtrls, StdCtrls, Buttons, jpeg, Menus; Procedure TForm6. BitBtn3Click (Sender: TObject); Procedure TForm6… Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π΅Ρ‰Ρ‘ >

Листинг ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. ΠœΠ΅Ρ‚ΠΎΠ΄Ρ‹ ΠœΠΎΠ½Ρ‚Π΅-ΠšΠ°Ρ€Π»ΠΎ ΠΈ ΠΈΡ… использованиС Π² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ (Ρ€Π΅Ρ„Π΅Ρ€Π°Ρ‚, курсовая, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ)

unit Unit2;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, ExtCtrls, StdCtrls, Buttons, jpeg, Menus;

type.

TForm2 = class (TForm).

Label1: TLabel;

BitBtn1: TBitBtn;

Image1: TImage;

Label2: TLabel;

Edit1: TEdit;

Panel1: TPanel;

Panel2: TPanel;

BitBtn2: TBitBtn;

Label3: TLabel;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N21: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

procedure BitBtn1Click (Sender: TObject);

procedure BitBtn2Click (Sender: TObject);

procedure BitBtn3Click (Sender: TObject);

procedure BitBtn4Click (Sender: TObject);

procedure N3Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N21Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N2Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

const A = -Pi/2.0; B = pi/2.0; n = 1000;

var.

Form2: TForm2;

N_total:longint;

implementation.

uses Unit1, Unit3, Unit4, Unit5, Unit6, Unit8;

{$R *.dfm}.

Function FUNC (x:real):real;

begin.

Func:=Cos (x);

end;

Procedure Graphic (var right, down: integer;

var X_min, X_max, Y_min, Y_max, Kx, Ky: real);

type arr=array[1.n] of real;

var.

X, Y: arr; dx: real;

i: integer;

begin.

dx:=(B-A)/(n-1);

for i:=1 to n do begin X[i]: =A+dx*(i-1);

Y[i]: =FUNC (X[i]);

end;

{НахоТдСниС максимального ΠΈ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡŒΠ½ΠΎΠ³ΠΎ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ ΠΈ Π°Ρ€Π³ΡƒΠΌΠ΅Π½Ρ‚Π°}.

X_max:=B; X_min:=A;

Y_max:=Y[1]; Y_min:=Y[1];

for i:=2 to n do begin.

if Y_max < Y[i] then Y_max:=Y[i];

if Y_min > Y[i] then Y_min:=Y[i];

end;

{НахоТдСниС коэффициСнтов сТатия}.

Kx:=right/(X_max-X_min);

Ky:=down/(Y_max-Y_min);

{УстранСниС искаТСния Π³Ρ€Π°Ρ„ΠΈΠΊΠ°}.

if Kx < Ky then begin.

Ky:=Kx;

down:=round ((Y_max-Y_min)*Ky);

end.

else begin.

Kx:=Ky;

right:=round ((X_max-X_min)*Kx);

end;

end;

procedure TForm2. BitBtn1Click (Sender: TObject);

var N_total, N_fig, i: longint;

S_total, S_fig, X, Y:real;

Xg, Yg: integer;

X_min, X_max, Y_min, Y_max, Kx, Ky: real;

Right, Down: integer;

S:string;

begin.

randomize;

With Image1, Canvas do.

begin.

FillRect (ClientRect);

Right := Width;

Down := Height;

Graphic (Right, Down, X_min, X_max, Y_min, Y_max, Kx, Ky);

Width := Right ;

Height := Down ;

{РисованиС осСй}.

Xg:=round (-X_min*Kx);

Yg:=Down-round (-Y_min*Ky);

{Ось Y}.

MoveTo (Xg, Down);

LineTo (Xg, 0);

moveto (Xg, 0);

lineto (Xg+4, 10);

moveto (Xg, 0);

lineto (Xg-4, 10);

{Ось Π₯}.

MoveTo (0, Yg-1);

lineTo (Right, Yg-1);

moveto (Right, Yg);

lineto (Right-10, Yg+5);

moveto (Right, Yg);

lineto (Right-10, Yg-5);

N_fig:=0;

N_total:=StrToInt (Edit1.Text);

{Π ΠΎΠ·Ρ‹Π³Ρ€Ρ‹Ρˆ ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚ Ρ‚ΠΎΡ‡Π΅ΠΊ}.

for i:=1 to N_total do.

begin.

X:=random*(B-A)+A;

Y:=random*(Y_max-Y_min)+Y_min;

if Y <= FUNC (X)then.

begin.

Xg:=round ((X-X_min)*Kx);

Yg:=Down-round ((Y-Y_min)*Ky);

Pixels[Xg, Yg]: =clBlack;

Application.ProcessMessages;

N_fig:=N_fig+1;

end;

end;

end;

S_fig:=(Y_max-Y_min)*(B-A)*N_fig/N_total;

Str (S_fig:10:4,S);

Panel1.Caption:='ΠŸΠ»ΠΎΡ‰Π°Π΄ΡŒ Ρ„ΠΈΠ³ΡƒΡ€Ρ‹ = '+S;

Panel2.Caption:='Pi = 3.1416';

end;

procedure TForm2. BitBtn2Click (Sender: TObject);

begin.

Form1.Show;

Form2.Hide;

end;

procedure TForm2. BitBtn3Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

procedure TForm2. BitBtn4Click (Sender: TObject);

begin.

Image1.picture:=nil;

Panel1.Caption:='';

end;

procedure TForm2. N3Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

procedure TForm2. N4Click (Sender: TObject);

begin.

Form1.Show;

Form2.Hide;

end;

procedure TForm2. N21Click (Sender: TObject);

begin.

Form3.Show;

end;

procedure TForm2. N6Click (Sender: TObject);

begin.

Form5.Show;

end;

procedure TForm2. N5Click (Sender: TObject);

begin.

Form4.Show;

end;

procedure TForm2. N7Click (Sender: TObject);

begin.

Form6.Show;

end;

procedure TForm2. N2Click (Sender: TObject);

begin.

Form8.Show;

end;

end.

unit Unit3;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, StdCtrls, ExtCtrls, Math, Buttons, Menus;

type.

TForm3 = class (TForm).

PaintBox1: TPaintBox;

Label1: TLabel;

Edit1: TEdit;

Label2: TLabel;

Edit2: TEdit;

Label3: TLabel;

Edit3: TEdit;

Memo1: TMemo;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

BitBtn3: TBitBtn;

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N11: TMenuItem;

Label4: TLabel;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

procedure PaintBox1Paint (Sender: TObject);

procedure BitBtn1Click (Sender: TObject);

procedure BitBtn2Click (Sender: TObject);

procedure BitBtn3Click (Sender: TObject);

procedure N11Click (Sender: TObject);

procedure N3Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N2Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

var.

Form3: TForm3;

KH: Integer; //ΠšΠΎΠ»ΠΈΡ‡Π΅ΡΡ‚Π²ΠΎ шагов сСтки.

sH: Integer = 0; //Π¨Π°Π³ сСтки Π² ΠΏΠΈΠΊΡΠ΅Π»Π°Ρ….

Tochka: TPoint; //Наша Ρ‚ΠΎΡ‡ΠΊΠ°.

ArrPoinr: Array Of TPoint;

implementation.

uses Unit1, Unit2, Unit4, Unit5, Unit6, Unit9;

{$R *.dfm}.

procedure TForm3. PaintBox1Paint (Sender: TObject);

Var.

i: Integer;

begin.

If sH=0 Then Exit;

//ΠŸΠ΅Ρ€Π΅Ρ€ΠΈΡΠΎΠ²ΠΊΠ° ΠΏΡƒΡ‚ΠΈ Ρ‚ΠΎΡ‡ΠΊΠΈ…

With PaintBox1, PaintBox1. Canvas Do.

Begin.

Pen.Color:=clBlack;

//ΠžΡ‡ΠΈΡ‰Π°Π΅ΠΌ ΠΏΠΎΠ»Π΅…

FillRect (ClientRect);

//РисуСм сСтку…

Pen.Width:=1;

for i:=0 to KH do.

begin.

moveto (Min (i*sH, Width-1), 0);

lineto (Min (i*sH, Width-1), Height);

moveto (0,Min (i*sH, Height-1));

lineto (Width, Min (i*sH, Height-1));

end;

Pen.Width:=2; //Π’Π΅Π»ΠΈΡ‡ΠΈΠ½Π° Π»ΠΈΠ½ΠΈΠΈ ΠΌΠ΅ΠΆΠ΄Ρƒ Ρ‚ΠΎΡ‡ΠΊΠ°ΠΌΠΈ.

Pen.Color:=clRed;

moveto (ArrPoinr[0]. X*sH, ArrPoinr[0].Y*sH);

Ellipse (ArrPoinr[0]. X*sH-2,ArrPoinr[0].Y*sH-2,ArrPoinr[0].X*sH+2,ArrPoinr[0].Y*sH+2);

For i:=1 To Length (ArrPoinr)-1 Do.

Begin.

//Линия Π΄ΠΎ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ Ρ‚ΠΎΡ‡ΠΊΠΈ.

Lineto (ArrPoinr[i]. X*sH, ArrPoinr[i].Y*sH);

Ellipse (ArrPoinr[i]. X*sH-2,ArrPoinr[i].Y*sH-2,ArrPoinr[i].X*sH+2,ArrPoinr[i].Y*sH+2);

End;

End;

end;

procedure TForm3. BitBtn1Click (Sender: TObject);

Var.

r: Byte;

begin.

Randomize;

Memo1.Lines.Clear;

KH:=StrToInt (Edit1.Text);

//ΠΠ°Ρ‡Π°Π»ΡŒΠ½Ρ‹Π΅ ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ Ρ‚ΠΎΡ‡ΠΊΠΈ.

Tochka.X:=StrToInt (Edit2.Text);

Tochka.Y:=StrToInt (Edit3.Text);

sH:=(PaintBox1.Height Div KH);

SetLength (ArrPoinr, 1); //Для ΠΏΠ΅Ρ€Π²ΠΎΠΉ Ρ‚ΠΎΡ‡ΠΊΠΈ.

ArrPoinr[0]: =Tochka; //ΠŸΠ΅Ρ€Π²ΠΎΠ΅ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Ρ‚ΠΎΡ‡ΠΊΠΈ Π² ΠΌΠ°ΡΡΠΈΠ².

//ΠŸΠ΅Ρ€Π΅ΠΌΠ΅Ρ‰Π°Π΅ΠΌ Ρ‚ΠΎΡ‡ΠΊΡƒ…

Repeat.

r:=Random (101);

Case r Of.

0.25: Tochka. X:=Tochka.X+1;

26.50: Tochka. Y:=Tochka.Y-1;

51.75: Tochka. X:=Tochka.X-1;

76.100: Tochka. Y:=Tochka.Y+1; //Π’Π½ΠΈΠ·.

End;

SetLength (ArrPoinr, Length (ArrPoinr)+1); //Для ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ Ρ‚ΠΎΡ‡ΠΊΠΈ.

ArrPoinr[Length (ArrPoinr)-1]: =Tochka; //ΠžΡ‡Π΅Ρ€Π΅Π΄Π½ΠΎΠ΅ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Ρ‚ΠΎΡ‡ΠΊΠΈ Π² ΠΌΠ°ΡΡΠΈΠ².

Memo1.Lines.Add (FloatToStrF (r/100,ffFixed, 6,2));

PaintBox1.OnPaint (Sender);

//.Refresh; //ΠŸΠ΅Ρ€Π΅Ρ€ΠΈΡΡƒΠ΅ΠΌ PaintBox.

Application.ProcessMessages; //ПозволяСм ΠΏΠ΅Ρ€Π΅Ρ€ΠΈΡΠΎΠ²Π°Ρ‚ΡŒ.

Until ((Tochka.X=0) Or (Tochka.Y=0) Or (Tochka.X=10) Or (Tochka.Y=10));

//ΠŸΠ΅Ρ€Π΅ΠΌΠ΅Ρ‰Π΅Π½ΠΈΠ΅ Π·Π°ΠΊΠΎΠ½Ρ‡Π΅Π½ΠΎ.

//SetLength (ArrPoinr) = количСство шагов пСрСмСщСния Ρ‚ΠΎΡ‡ΠΊΠΈ Π² ΠΌΠ°ΡΡΠΈΠ²Π΅.

//Π² Memo1 — Ρ‚ΠΎΠΆΠ΅ всС значСния пСрСмСщСния Ρ‚ΠΎΡ‡ΠΊΠΈ.

//Π—Π”Π•Π‘Π¬ ΠžΠ‘Π ΠΠ‘ΠžΠ’ΠšΠ…

sH:=0;

Finalize (ArrPoinr); //ОсвобоТдаСм ΠΏΠ°ΠΌΡΡ‚ΡŒ массива…

end;

procedure TForm3. BitBtn2Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

procedure TForm3. BitBtn3Click (Sender: TObject);

begin.

Form1.Show;

Form3.Hide;

end;

procedure TForm3. N11Click (Sender: TObject);

begin.

Form2.Show;

end;

procedure TForm3. N3Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

procedure TForm3. N5Click (Sender: TObject);

begin.

Form4.Show;

end;

procedure TForm3. N6Click (Sender: TObject);

begin.

Form5.Show;

end;

procedure TForm3. N7Click (Sender: TObject);

begin.

Form6.Show;

end;

procedure TForm3. N4Click (Sender: TObject);

begin.

Form1.Show;

Form3.Hide;

end;

procedure TForm3. N2Click (Sender: TObject);

begin.

Form9.Show;

end;

end.

unit Unit4;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, StdCtrls, Buttons, Menus;

type.

TForm4 = class (TForm).

BitBtn1: TBitBtn;

Memo1: TMemo;

Memo2: TMemo;

Label1: TLabel;

BitBtn2: TBitBtn;

BitBtn3: TBitBtn;

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

procedure BitBtn1Click (Sender: TObject);

procedure BitBtn2Click (Sender: TObject);

procedure BitBtn3Click (Sender: TObject);

procedure N2Click (Sender: TObject);

procedure N3Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N7Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

var.

Form4: TForm4;

x, y, i, k1, k2:integer; r, p: real; st: string;

implementation.

uses Unit1, Unit2, Unit3, Unit5, Unit6;

{$R *.dfm}.

procedure TForm4. BitBtn1Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

end;

procedure TForm4. BitBtn2Click (Sender: TObject);

begin.

Form1.Show;

Form4.Hide;

end;

procedure TForm4. BitBtn3Click (Sender: TObject);

begin.

randomize; k1:=0;

with form4. Canvas do begin.

for i:=1 to 200 000 do begin.

x:=random (300);

y:=random (300);

r:=sqrt ((x-150)*(x-150)+(y-150)*(y-150));

if r<=150 then begin.

Pixels[x+30, y+30]: =$ 00FF;

inc (k1);

end.

Else.

begin.

Pixels[x+30, y+30]: =$ 00FF0000;

end;

end;

p:=4*k1/200 000;

str (p, st);

TextOut (10, 300, st);

end;

end;

procedure TForm4. N2Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

procedure TForm4. N3Click (Sender: TObject);

begin.

Form1.Show;

Form4.Hide;

end;

procedure TForm4. N4Click (Sender: TObject);

begin.

Form2.Show;

end;

procedure TForm4. N5Click (Sender: TObject);

begin.

Form3.Show;

end;

procedure TForm4. N6Click (Sender: TObject);

begin.

Form5.Show;

end;

procedure TForm4. N7Click (Sender: TObject);

begin.

Form6.Show;

end;

end.

unit Unit5;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, Math, StdCtrls, ExtCtrls, Buttons, Menus;

type.

TForm5 = class (TForm).

Image1: TImage;

Edit1: TEdit;

Edit2: TEdit;

Label1: TLabel;

Label2: TLabel;

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

N8: TMenuItem;

procedure BitBtn1Click (Sender: TObject);

procedure BitBtn2Click (Sender: TObject);

procedure Edit1KeyPress (Sender: TObject; var Key: Char);

procedure Edit1KeyDown (Sender: TObject; var Key: Word;

Shift: TShiftState);

procedure BitBtn3Click (Sender: TObject);

procedure N2Click (Sender: TObject);

procedure BitBtn4Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N8Click (Sender: TObject);

procedure N3Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

var.

Form5: TForm5;

R: integer; //радиус.

N: integer; //количСство «Π±Ρ€ΠΎΡˆΠ΅Π½Π½Ρ‹Ρ…» Ρ‚ΠΎΡ‡Π΅ΠΊ.

X: real; //ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Π° Ρ‚ΠΎΡ‡Π΅ΠΊ X.

Y: real; //ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Π° Ρ‚ΠΎΡ‡Π΅ΠΊ Y.

M: integer; //количСство Ρ‚ΠΎΡ‡Π΅ΠΊ, ΠΏΠΎΠΏΠ°Π²ΡˆΠΈΡ….

I: integer;

implementation.

uses Unit1, Unit2, Unit3, Unit4, Unit10, Unit6;

{$R *.dfm}.

procedure TForm5. BitBtn1Click (Sender: TObject);

begin.

//Π‘Ρ‚ΠΈΡ€Π°Π½ΠΈΠ΅.

Image1.Canvas.Brush.Color := clWhite;

Image1.Canvas.Rectangle (100-R, 100-R, 100+R, 100+R); Image1.Canvas.FillRect (Rect (100-R, 100-R, 100+R, 100+R));

M:=0;

//Π’Π²ΠΎΠ΄ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ.

R:=StrToInt (Edit1.Text);

N:=StrToInt (Edit2.Text);

//РисованиС ΠΊΠ²Π°Π΄Ρ€Π°Ρ‚Π° ΠΈ ΠΊΡ€ΡƒΠ³Π°.

Image1.Canvas.Rectangle (100-R, 100-R, 100+R, 100+R); Image1.Canvas.Ellipse (100-R, 100-R, 100+R, 100+R); //ГСнСрация Ρ‚ΠΎΡ‡Π΅ΠΊ Randomize;

For I:=1 To N do begin.

X:=Random (2*R)-R;

Y:=Random (2*R)-R;

Image1.Canvas.Pixels[Round (X)+100,.

Round (Y)+100]: =clRed;

If Sqr (X)+Sqr (Y)<=Sqr®.

Then M:=M+1.

end;

//ΠŸΠ»ΠΎΡ‰Π°Π΄ΡŒ.

Label1.Caption:=FloatToStr (4*Sqr®*M/N);

//Число PI.

Label2.Caption:=FloatToStr (4*M/N);

end;

procedure TForm5. BitBtn2Click (Sender: TObject);

begin.

Image1.picture:=nil;

label1.caption:='Π’Ρ‹Π²ΠΎΠ΄ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ ΠΏΠ»ΠΎΡ‰Π°Π΄ΠΈ ΠΊΡ€ΡƒΠ³Π°';

label2.caption:='Π’Ρ‹Π²ΠΎΠ΄ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ числа Pi';

end;

procedure TForm5. Edit1KeyPress (Sender: TObject; var Key: Char);

const.

D = ['0', '1', '5', #8];

begin.

if not (Key in D) then Key := #0;

end;

procedure TForm5. Edit1KeyDown (Sender: TObject; var Key: Word;

Shift: TShiftState);

begin.

if (ssShift in Shift) and (Key = VK_INSERT) then Abort;

end;

procedure TForm5. BitBtn3Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

end;

procedure TForm5. N2Click (Sender: TObject);

begin.

Form10.Show;

end;

procedure TForm5. BitBtn4Click (Sender: TObject);

begin.

Form1.Show;

Form5.Hide;

end;

procedure TForm5. N4Click (Sender: TObject);

begin.

Form1.Show;

Form5.Hide;

end;

procedure TForm5. N5Click (Sender: TObject);

begin.

Form2.Show;

end;

procedure TForm5. N6Click (Sender: TObject);

begin.

Form3.Show;

end;

procedure TForm5. N7Click (Sender: TObject);

begin.

Form4.Show;

end;

procedure TForm5. N8Click (Sender: TObject);

begin.

Form6.Show;

end;

procedure TForm5. N3Click (Sender: TObject);

begin.

Form1.close;

Form2.Close;

Form3.Close;

Form4.Close;

Form5.Close;

Form6.Close;

end;

end.

unit Unit6;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, StdCtrls, Buttons, Menus, ExtCtrls;

type.

TForm6 = class (TForm).

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

Edit1: TEdit;

Edit2: TEdit;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

BitBtn5: TBitBtn;

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

Panel1: TPanel;

Panel2: TPanel;

BitBtn6: TBitBtn;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

N8: TMenuItem;

procedure BitBtn3Click (Sender: TObject);

procedure BitBtn1Click (Sender: TObject);

procedure BitBtn2Click (Sender: TObject);

procedure BitBtn4Click (Sender: TObject);

procedure BitBtn5Click (Sender: TObject);

procedure N3Click (Sender: TObject);

procedure BitBtn6Click (Sender: TObject);

procedure N2Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N8Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

var.

Form6: TForm6;

N: integer;

M: integer;

implementation.

uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit11;

{$R *.dfm}.

procedure TForm6. BitBtn3Click (Sender: TObject);

var x0, y0, y, a: real;

b, k, i, c: integer;

begin.

Randomize;

k:=0;

c:= strtoint (Form6.Edit2.Text);

For i:=1 to c do.

begin.

x0:=Random (100)+250;

//a:=round ((x0−250)/10);

a:=(x0−250)/10;

y0:=250 — a*a;

y:=Random (100)+ 150;

If y.

begin.

k:=k+1;

Canvas.Pixels [round (x0), round (y)]: =clNavy;

end;

end;

N:=k;

M:=c;

end;

procedure TForm6. BitBtn1Click (Sender: TObject);

var.

a:integer;

b: integer;

x0, y0: real;

x, y: real;

begin.

with Canvas do.

begin.

TextOut (250, 35, 'y'); // надпись ΠΎ…

ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ вСсь тСкст
Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Ρ€Π°Π±ΠΎΡ‚ΠΎΠΉ