Версия для печати темы

Нажмите сюда для просмотра этой темы в обычном формате

Форум «Всё о Паскале» _ Теоретические вопросы _ GraphABC+CRT

Автор: Vikki 15.04.2016 3:06

помогите, пожалуйста, очень срочно нужно. Нужно чтобы пользователь ввел числе ед. отрезков для построения, как это правильно осуществить. вот сам код программа. что нужно в него добавить? заранее огромное спасибо!
uses CRT,graphABC;
var s,w,n,x,y,d,m,xe,ye,yf: integer;
c:char;
label l,loop,loop1,loop2,loop3,loop4,loop5,loop6;

begin
l:
setwindowsize(1250,690);
line(0,100,1360,100);
line(1000,100,1000,690);
SetFontStyle (fsBold);
textout(10,15,'Äàííàÿ ïðîãðàììà ïîêàçûâàåò íàõîæäåíèå ñåðåäèíû îòðåçêà, áåç ëèíåéêè, äëèíà êîòîðîãî îïðåäåëÿåòñÿ ïîëüçîâàòåëåì');
textout(70,60,'- Åäåíè÷íûé îòðåçîê.');
textout(250,60,'Ââåäèòå äëèííó îòðåçêà "n" (íå áîëåå 45) - ');
textout(700,60,'Íàæìèòå "enter" äëÿ ïîøàãîâîãî ïîñòðîåíèÿ.');
textout(1010,110,'Àëãîðèòì:');


SetPenWidth(2);
textout(15,55,'A');
textout(55,55,'B');
circle(30,70,2);
circle(50,70,2);
line(30,70,50,70);

loop:
c:=readkey;
if not (c in [#13]) then goto loop;
if c = #13 then begin
x:=50;
y:=400;
d:=n*20;
SetPenWidth(0);
line(x,y,x+d,y);
setbrushcolor(clblack);
circle(x,y,2);
circle(x+d,y,2);
setbrushcolor(clwhite);
textout(1010,130,'1)[A1B1]-äàí');
end;

loop1:
c:=readkey;
if not (c in [#13]) then goto loop1;
if c = #13 then begin
Arc(x,y,d,270,450);
textout(1010,150,'2)îêð1.(ò.A1,|A1B1|)');
end;

loop2:
c:=readkey;
if not (c in [#13]) then goto loop2;
if c = #13 then begin
Arc(x+d,y,d,90,270);
textout(1010,170,'3)îêð2.(ò.B1,|A1B1|)');
end;

loop3:
c:=readkey;
if not (c in [#13]) then goto loop3;
if c = #13 then begin
setbrushcolor(clblack);
xe:=x+round(d/2);
ye:=y+round(Sqrt(Sqr(d)-Sqr(d/2)));
yf:=y+round(-Sqrt(Sqr(d)-Sqr(d/2)));
circle(xe,ye,3);
circle(xe,yf,3);
setbrushcolor(clwhite);
textout(xe-10,ye+5,'E');
textout(xe-10,yf+5,'F');
textout(1010,190,'4)îêð1 ïåðåñåê. îêð2=ò.E è ò.F');
end;

loop4:
c:=readkey;
if not (c in [#13]) then goto loop4;
if c = #13 then begin
line(xe,ye+20,xe,yf-20);
textout(1010,210,'5)(EF)');
end;

loop5:
c:=readkey;
if not (c in [#13]) then goto loop5;
if c = #13 then begin
setbrushcolor(clblack);
circle(xe,y,5);
setbrushcolor(clwhite);
textout(1010,230,'6)(EF) ïåðåñåê.[A1B1]=ò.O');
end;

loop6:
c:=readkey;
if not (c in [#13]) then goto loop6;
if c = #13 then begin
textout(1010,250,'6)ò.O-èñêîìàÿ');
textout(xe-10,y+5,'O');
end;
hideCursor;
end.