WWW.DISSERS.RU


...
    !

Pages:     | 1 |   ...   | 12 | 13 || 15 | 16 |   ...   | 21 |

} getch();// aepa opa paa o aa o a closegraph(); // ape paecoo pea exit(1); // Bxo popa } void main(void) // aa y (ocoo o popa) { fileinfo(); // Bcee oeca oe paa, acax ae getmemory(); // Pacpeeee acco, coepax ae oopa // oe paa, aeco a readfile(); // ee oopa oe paa aa avtor(); // Bo opa o aope ao popa tablica(); // Bo a c oopaa oe paa init(); // aa paecoo pea masshtab(); // Opeeee acaa o oc setka(); // ocpoee oopao ce systemcoord(); // ocpoee cce oopa grafic(); // ocpoee paa y freememory(); // Ocooee aeco a, aaeo acca } puep nocmpoeu paua a acae:

{-------------------------------------------------------------------} {aa popaa ooe pacca ae y aao} {ce oe, a aao epae ocpo pa y a} {o epae c aoaec acapoae o ec pa.} {-------------------------------------------------------------------} {* Bae! p a epax aco y a *} {* paccapaeo epae popaa e ye paoa.*} {-------------------------------------------------------------------} PROGRAM FUNCTION_TAB_AND_GRAPH;

uses GRAPH, CRT; {oee oe y poeyp pao c} {pao oa-oa} {Oee epeex} var gd, gm, x, y, xmax, xmin, x0, y0, mx, my : Integer;

a, b, ymax, ymin, dx, d, c, h : Real;

d1 : String[5];

s : Char;

{aaec y ocpoe a paa} Function f(x:Real):Real;

begin f := Sin(x*x)+Cos(x);

end;{Function f} {B ao poeype pooc ocpoee paa y} Procedure GraphFunc(a,b:real);

begin gd := Detect; {aa paecoo pea} gm := 0; { c aoaec opeeee } InitGraph(gd,gm,'d:\bp\bgi'); {a paecoo aaepa} {Haxoc aca o oc accc mx} if Frac(a)<0 then xmin := Trunc(a)-else xmin := Trunc(a);

if Frac(b)>0 then xmax := Trunc(b)+else xmax := Trunc(b);

mx := Trunc(600/(xmax-xmin));

ymax := f(a);

ymin := f(a);

d := a;

dx := (b-a)/600; {a ee apyea, cooecy ooy} repeat {ce opae a pae} d := d + dx;

if f(d) > ymax then ymax := f(d); {oc acaoo aoo} if f(d) < ymin then ymin := f(d); {ae y} until d >= b;

{Haxoc aca o oc opa my} if Frac(ymin)<0 then ymin := Trunc(ymin)-else ymin := Trunc(ymin);

if Frac(ymax)>0 then ymax := Trunc(ymax)+else ymax := Trunc(ymax);

my := Trunc(440/(ymax-ymin));

if ymax*ymin <= 0 then begin { Haxoc aa opaa oc accc y0} y0 := 460+Trunc(ymin)*my;

Line(10,y0,620,y0); {Cpoc oc accc aaec ee apaee} Line(615,y0+5,620,y0);

Line(615,y0-5,620,y0);

end;

if (ymax*ymin>0) and (ymax>0) then y0 := 460+Trunc(ymin)*my;

if (ymax*ymin>0) and (ymax<0) then y0 := 20-Round(ymax*my);

if xmax*xmin <= 0 then begin{ Haxoc aa accca oc opa } x0 := 20-xmin*mx;

Line (x0,20,x0,460);{ Ec pa epeceae oc opa, } Line (x0-5,25,x0,20); { oa cpoc aaec ee apaee } Line (x0+5,25,x0,20);

end;

SetLineStyle(CenterLn,0,NormWidth); {caaaec c } x := 20; {Haxoc aaa aa accca ocpoe oopao ce} d := xmin; {caaaec aaoe aee apyea,} {ooo o oc accc} If (y0>20) and (y0<460) then gd := y0 else gd := 460;

repeat SetColor(2); {caaaec e coo} if d=0 then SetColor(15); {B cyae coae acaa c oc} {accc ycaaae e oopao coaa c oc} Line(x,20,x,460); {Cpoc aca o oc accc} Str(d:3:0,d1); {poo peopaoae epeex a Real Char} SetColor(15);

OutTextXY(x-5,gd+5,d1); {Boc ae apyea o oc accc} d := d+1;

x := x+mx;

until x > 630;

{caaaec aaoe aee y, oo o oc opa} d := ymin;

y := 460; { Haxoc aaa aa } { opaa ocpoe oopao ce } If (x0>20) and (x0<460) then gd:=x0 else gd := 20;

repeat SetColor(2);

if d=0 then SetColor(15);

Line(10,y,620,y); { Cpoc aca o oc opa } Str(d:3:0,d1);

SetColor(15);

OutTextXY(gd-5,y-10,d1);

y := y-my;

d := d+1;

until y<15;

{oc aao ao accc ocpoe paa} if (a<0) and (Frac(a)<>0) then x := Round((1+Frac(a))*mx)+20;

if Frac(a)=0 then x := 20;

if (a>=0) and (Frac(a)<>0) then x := Round(Frac(a)*mx)+20;

d := dx;

MoveTo(Trunc(mx*dx)+x,y0-(Trunc(f(a)*my))); {oopoae ypcopa} SetLineStyle(SolidLn,0,NormWidth);

repeat {ocpoee paa y a aao epae} LineTo(Trunc(mx*dx)+x,y0-Trunc(f(a)*my));

dx := dx+d;

a := a+d;

until a>b;

OutTextXY(20, 470, ' xoa popa ae y ay.');

ReadKey; { aepa paa } CloseGraph; { ape paecoo pea } end;{Procedure GraphFunc} begin {Ocoo o popa} ClrScr; {Oca paa ecoo pee} WriteLn('Cocae oo .., T, p. P-11');

WriteLn('Bee pa epaa');

Read(a,b); {Boc pa epaa} if b

end;

WriteLn('Bee oeco pae');

Read(d); {Boc co poeyo pae epaa} h:=(b-a)/d; {Paccaec a ee apyea aoe a} WriteLn('a pae:',h:3:3);

{Boc aa ae y, cooecyx ae apyea,} {eeoc c ce e ao, oep o pae} WriteLn('-------------T-----------------T---------------- ');

WriteLn(' ');

GotoXY(2,WhereY-1); {pooc aoaeca apeca ypcopa} Write('Hoep o'); {aao ao pa a ea eca} GotoXY(16,WhereY);

Write('a. apy.');

GotoXY(34,WhereY);

Write('a. y');

GotoXY(1,WhereY+1);

y:= WhereY+1;

c:= 1;

d:= a;

repeat WriteLn('+------------+-----------------+----------------+ ');

Write(' ');

GotoXY(4,y); {pooc aoaeca apeca ypcopa} Write(c:3:0); { ay pay a ea cooecyeo } GotoXY(16,y); { ceoo ae } Write(d:3:4);

GotoXY(34,y);

Write(f(d):3:5);

GotoXY(1,y+1);

d := d+h;

y := y+2;

c := c+1;

until d >= b+h;

WriteLn('L------------+-----------------+----------------- ');

{ Boc apoc a ocpoee paa y } WriteLn('Cpo pa y a aao poeye (Y/N)');

s := ReadKey; {Caec o c aayp co} if s in ['y','Y'] then begin if a=b then {poepa oooc ocpoe paa} begin WriteLn (' ocpoee paa eooo ');

WriteLn (' Hae y ay ');

ReadKey; {Bxo popa p} Halt(1); {aa o a} end else GraphFunc(a,b); {Baec poeypa ocpoe paa y } end;

end.

a ae pac pe e e e a C acae AATE B C Bce paccopee ax coepa eocpeceo ae. aame coep pyo opa apec. aame o epeea, coepaa apec a, e ae o ae oeac.

py coa, o yaae a ae, a apeca a oaee.

Co oepa * coyec aa yaae a oe. Hapep, paccop ceyee ocae:

int *x;

eo ceye oa, a "x ec yaaee a eoe". aae a void coec c yaaee.

ooy oo poo ceyee pcaae, anpuep:

void *x;

int *y;

y=x;

B oe cyae ocaec a: mun * nepeea_yaame; aa ac oaae, o epeea_yaae emc yaamee a mun.

y aoee a oepa, ca c yaaee, c onepauu opaeu no apecy * (oa aaec oepae c cc) onepau onpeeeu apeca &.

Oepa opae o apecy * cy pcaa ca ae epeeo, paeeo o apecy epeea_yaae, p oo eo-opeeeoo pae * epeea_yaae. Hapep, *ptr_var=value;

Oepa opeee apeca & opaae apec a coeo oepaa. Oepao oa epeea. Boec cey opao:

apec=& epeea;

e apec o cooecyee eo-opeeeoe paee, ya oeaec apec, a epeea epeeo, opeeeo e popae. Paep opaaeoo apeca ac o oe a.

pcoee *x=16 oaae, o o apecy, aaaeoy x, oeaec aee 16. ec oepa * coyec a opaee o apecy (ce cc).

p paoe c yaae x eoxoo paea aeco a (ye). o eaec p oo y oe anpuep:

#include main() {int *x;

x=(int *) malloc (sizeof(int)); // paeee a free(x); //ocooee a } AATE B ACAE Oo yaae yaae a ae opeeeoo a. Paccop cey pep:

type Buffer = string[255];

BufPtr = ^Buffer;

var Buf1: Buffer;

Buf2: BufPtr;

T ax Buffer opeee, a cpooa epeea paepo 255 a, o e pe BufPtr yaae a Buffer. epeea Buf1 ee Buffer aae (255+1) a a. epeea Buf2 ee BufPtr, o 32o apec aae 4 aa a.

ya yaae Buf2 B a oe ya. pee e cooa BufPtr, eoxoo apeeppoa (pacpee) a ao ee apec Buf2, coy poeypy New:

New(Buf2);

ocoy Buf2 yaae a Buffer, o o oepaop e a 256-ao yep eo apec oec Buf2.

a cooa Buf2 ae, a oope o yaae C oo oepaopa ^. Hapep, eoxoo oec cpoy Buf1 yep, a oop yaae Buf2:

Buf1: = 'a cpoa oeaec Buf1';

Buf2^: = 'a cpoa oeaec o yaae Buf2';

Oe pae ey Buf2 Buf2^: Buf2 oaae 4-aoy epeey yaae; Buf2^ 256-aoy cpooy epeey, apec oopo Buf2.

Ocoo a, a oopy yaae Buf2 oo, coy poeypy Dispose. a poeypa ocooae a.

oce oo, a p oo Dispose ocooea a, ceye pco yaae aee nil, .e.

yaae a o e yaae:

Dispose(Buf2);

Buf2 := nil;

ae, o aee nil pcaaec yaae Buf2, a e Buf2^.

APECHE OEPATOP B acae oepac a ceax oepaopa a apeca: cee apeca (@) oepaop oceo cc (^).

Oepaop @ opaae apec aao epeeo; ec Sum epeea eoo a, o @Sum apec a o epeeo.

Aaoo, ec ChrPtr o yaae a Char, o ChrPtr^ o co, a oop yaae ChrPtr^.

a p a a a c a e apa a acae ee cey (pc. 12) Bepx paa a DOS HeapEnd cooa a HeapPtr ya (pace epx) HeapOrg OvrHeapEnd oepe yep QvrHeaporg ce (pace ) SSeg:SPtr coo ce SSeg:oae epeee poae oca DSeg:oo cee oy System oo cee epoo oy oo cee pyx oye coepa opa.EXE aa oo cee oceeo oy..

oo cee ao popa epe ceea popa (PSP) PrefixSeg H paa a DOS Pc. 12 Pacpeeee a popa a aca pec ceea popa (Program Segment Prefix PSP) o 256- aoa oac, coaaea DOS p apye popa. Apec ceea PSP xpac epeeo PrefixSeg. a oy ( aa popaa a oy) ee co oo cee. aa popaa aae ep oo cee; ooe cee, oope cey a , aa oy ( ope, opao oy, a o ceoa oepaope uses), oce oo cee aae oea pee oe (oy System). Paep ooo oooo ceea e oe pea 64 , o o paep oa opae oo eec a.

C e e a x Maca paep ceea ax pae 65 520 a. p oooe popa (o aoaec ocyecec oe o popa) oae epeee cex oye, coyex popao, a ae cocee oae epeee popa paeac ceee ax.

Ec oax epeex peyec oee 65 520 a, o ceye pacpee oe cpyyp e aecx epeex.

Ce e c e a Paep ceea cea ycaaaec c oo pe oopa {$M} e peeax o 1024 o 65 520 a. o yoa paep cea pae 16 384 a.

p ao aa (oe) poeyp y ce oeaec aop oax epeex. p aepe pao a, aaea oa epee, ocooaec. B o oe oe popa o paep oax epeex ax poeypax yx e oe pea paepa ceea cea.

pea oopa {$S} coyec poee poepo epeoe cea popae. B coco {$S+}, po o yoa, eeppyec o, ocyec poepy epeoe cea aae ao poeyp y. B coco {$S-} ae poep e pooc. epeoee cea oe a aapoe aepee pao cce, ooy e ceye oe poep cea, ec e acoo yepeoc o, o epeoe e pooe.

Cee ax (apecye epe DS) coep ce oae epeee, ae ce poae oca. Pecp DS oa e eec o pe oe popa. Paep ceea ax e oe pea 64 .

Pages:     | 1 |   ...   | 12 | 13 || 15 | 16 |   ...   | 21 |



2011 www.dissers.ru -

, .
, , , , 1-2 .