.


:




:

































 

 

 

 





, , . .

 

UNIT Cmplx;

{}

INTERFACE

{}

type

complex = record

re,im: real

end

Procedure AddC (x,y: complex; var z: complex);

Procedure SubC (x, : complex; var z: complex);

Procedure MulC (x, : complex; var z: complex);

Procedure DivC (x, : complex; var z: complex);

Const: complex = (re: 0.1: im:-1);

{}

IMPLEMENTATION

{}

Procedure AddC;

begin

z.re:= x.re - y.re;

z.im:= x.im + y.im

end; {AddC}

 

Procedure SubC;

begin

z.re:= x.re - y.re;

z.im:= x.im - y.im

end; {SubC}

 

Procedure MulC;

begin

z.re:= x.re * y.re - x.im * y.im;

z.im:= x.re * y.im + x.im * y.re

end; {MulC}

 

Procedure DivC: var zz: real;

begin

zz:= sgr(y.re) + sgr(y.im);

z.re:= (x.re * y.re + x.im * y.im) / zz;

z.im:= (x.re * y.im - x.im * y.re) / zz;

end {DivC}

end.

 

CMPLX.PAS. , TPU-, . , .

. 5.3.

 

Uses Cmplx;

Var f, b, : complex;

Begin

a.re: = 1; a.im:= 1; b.re:= 1; b.im:= 2;

AddC (a, b, c);

WriteLn (: , c.re:5:1, c.im:5:1,i);

SubC (a, b, c);

WriteLn (: , c.re:5:1, c.im:5:1,i);

MulC (a, b, c);

WriteLn (: , c.re:5:1, c.im:5:1,i);

DivC (a, b, c);

WriteLn (: , c.re:5:1, c.im:5:1,i);

End.

 

Uses Cmplx , CMPLX. , , , . , . , : . ,

WriteLn(cmplx.c.re:5:1, cmplx.c.im:5:1,i);

5.3.

: SYSTEM, DOS, CRT, PRINTER, GRAPH, OVERLAY, TURBO3 GRAPH3. GRAPH, TURBO3 GRAPH3 TPU-, TURBO.TPL. SYSTEM , , USES.

.

SYSTEM. , , . , . , :

- : bs, ArcTan, Cos, Sin, Exp, Frac, Int, Ln, Pi, Sqr, Sqrt;

- : Dec ( ), Inc ( );

- : Odd ( ), Pred ( ),Succ ( );

- : Delete ( ); Insert ( ); Str ( ); Val ( );

- : Concat ( ); Copy ( ); Length ( ); Pos ( );

- : Chr ( ); High ( ); Low ( ); Ord ( ); Round ( ); Trunc ( );

- -: Eof ( ); FileSize ( ) ;

- -: Append ( ); Assign ( ); Close ( ); Read ( ); Write ( ); Reset ( ) ;

- (6 );

- (12 );

- : Break ( ); Continue ( ); Exit ( ); Halt ( ): RunError ( );

- : Random ( ); Randomize ( ) (11 );

CRT. , . , , , , , , . CRT , - , . . . CRT , . .

CRT:

- TextMode;

- : HighVideo ( ); LowVideo ( ); NortVideo ( ); TextBackground ( ); TextColor ( );

- : CIrEol ( ); CIrScr ( ); DelLine ( , ); GotoXY ( ); InsLine ( ); Window ( );

- : WhereX ( ); WhereY ( Y );

- : KeyPressed ( ); ReadKey ( );

- : Sound ( ); NoSound ( );

- : Delay ( ); AssignCrt ( CRT).

PRINTER. . LST TEXT PRN. :

 

Program Primer;

Uses Printer;

Begin Writeln (LST, ) End.

GRAPH. , , . , , . . - , . : Y. ( 320200 1024768). GRAF 81 .

DOS. 34 , MS-DOS.

OVERLAY. . 580 . - . , 0+. , , ( {$F+}). USES $O unitname .

[4, .570-590; 5, .109-195], .



, , , . ( , , CD ..), . , MS DOS, . , . , , .





:


: 2016-11-18; !; : 1426 |


:

:

,
==> ...

2000 - | 1765 -


© 2015-2024 lektsii.org - -

: 0.011 .