type TForm1 = class(TForm) Button1: TButton; Image1: TImage; Edit1: TEdit; Label1: TLabel; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var x,y,t:real; x1,y1,M:integer; //M -коэффициент масштабирования begin x1:=Image1.Width div 2; y1:=Image1.Height div 2; with Image1.Canvas do begin MoveTo(x1,0); LineTo(x1,Image1.Height); MoveTo(x1,0); LineTo(x1-5,10); MoveTo(x1,0);LineTo(x1+5,10); MoveTo(0,y1);LineTo(Image1.Width,y1); LineTo(Image1.Width-10,y1-5); MoveTo(Image1.Width,y1); LineTo(Image1.Width-10,y1+5); TextOut(x1+1,y1+1,'0'); TextOut(Image1.Width-16,y1+2,'X'); TextOut(x1-15,0,'Y'); x := -200; y := 1/x; M:=strtoint(edit1.text); moveto(x1+round(x)*M,(y1-round(y)*M)); repeat x:=x+0.1; if x<>0 then //точка разрыва begin y := 1/x; lineto(x1+round(x*M),(y1-round(y*M))); end else begin x:=x+0.1; y := 1/x; MoveTo(x1+round(x*M),(y1-round(y*M))); end; until x>=200; end; end;
procedure TForm1.FormCreate(Sender: TObject); begin Label1.Caption:='коэффициент масштабирования'; Button1.Caption:='Построить'; Edit1.Text:='15'; Button1.OnClick(sender);//Построение end;
Приходить на работу нетрезвым не красть еду у коллег грубо и вызывающе себя вести неприемлемо нельзя зависать в соц сетях играть в комп игры нельзя нецензурно выражаться не уместны личные беседы по телефону надо выглядеть чисто и опрятно здоровайтесь не опаздывайте помнить о времени,оно у всех ограничено и конечно не провоцировать ссоры в коллективе
Var a:array[1..10] of real; i:integer; begin write('Исходный массив: '); for i:=1 to 10 do begin a[i]:=random(21)-10+random; write(a[i]:0:2,' '); end; WRITELN; write('Изменённый массив: '); for i:=1 to 10 do begin if i mod 2 = 0 then a[i]:=a[i]/2; write (a[i]:0:2,' '); end; end.
var a:array[1..7] of integer; i:integer; begin write('Исходный массив: '); for i:=1 to 7 do begin a[i]:=random(11); write(a[i],' '); end; WRITELN; write('Изменённый массив: '); for i:=1 to 7 do begin if a[i] mod 10 = 0 then a[i]:=0; write(a[i],' '); end; end.