.


:




:

































 

 

 

 





 

. 4

1. Borland Pascal 7.0. 5

2. .. 12

3. . 18

4. .. 27

5. .. 33

6. .. 39

7. .. 44

8. . 50

9. .. 55

.. 59


 

- , 230100 .

220400 .

. Borland Pascal 7.0.

:

¾ , ;

¾ , ;

¾ , .

, . .

.

 

 


1. Borland Pascal 7.0

: Pascal Borland Pascal 7.0.

 

:

¾ Borland Pascal 7.0;

¾ ;

¾ .

 

: , : [4: 2.1, 2.2], [9: 2.1], [10: 1, 1.2].

 

() Borland Pascal BP. , , :

BIN ,

UNITS ,

BGI ,

DOC ,

EXAMPLES ,

SOURCE .

Borland Pascal (, C:\BP\BIM D:\BP\BIN) BP.EXE.

, 1. F10.

, , . . , .

 

1. Borland Pascal

 

File:

New ( NONAMExx.PAS, xx ).

Open (F3) .

Save (F2) .

Save all .

Change dir .

Exit .

Edit:

Undo (Alt+BackSpace) .

Cut (Shift+Del) . Shift.

Copy (Ctrl+Ins) .

Paste (Shift+Ins), , .

Clear (Ctrl+Del) .

. , , , .

 

Search

Find .

Replace .

Search again Find Replace.

Run

Run (Ctrl+F9) .

Step over (F8) .

Tarce into (F7) , .

Go to cursor (F4) , .

Program reset (Ctrl+F2) .

Parameters , .

Compile

Compile (Alt+F9) .

Make (F9) exe- , .

Build exe-, .

Primary file , Make Build.

Debug

Breakpoints , .

Call stack (Ctrl+F3) .

Register .

Watch .

Output .

User screen (Alt+F5) , , , .

Evaluate/modify (Ctrl+F4) / .

Add watch (Ctrl+F7) / Watch.

Add breakpoint .

Options

Compiler .

Linker .

Debugger .

Directories , Pascal.

Browser Browse.

Environment .

Open .

Save , .

Save as .

Window

Size/Move (Ctrl+F5) .

Zoom (F5) .

Next (F6) .

Previos (Shift+F6) .

Close (Alt+F3) .

List (Alt+0) .

Help

Contents .

Index (Shift+F1) .

Topic search (Ctrl+F1) , .

:

1. Borland Pascal.

2. ( File -> Change dir).

3. File -> New, , .

4. .

5. ( File -> Save as), .

6. ( Run -> Run (Ctrl+F9)) , .

7. (. 2) . ( ), , ( ), , .

 

 

2.

 

. Error 85: ; expected. (; ) , .

 

8. , , (File -> Save).

9. ( Run -> Run) .

10. , , ( Debug -> User screen).

. , , ! .

 

11. , 6-10.

12. ( File -> Save).

13. ( File -> Quit).

1. Borland Pascal 7.0.

2. - ( 1) , .

1. X Y.

 

program X_Y;

var

x, y, z: integer;

begin

writ(' X');

read(x);

write(' Y');

readln(y)

z:=x;

x:=y;

y = z;

writeln(' x y);

write ('x=', x ' y=' Y);

Readln;

Readln;

End

 

. , , . .

 

3. 2 , .

 

2. X1, X2 Y1, Y2.

 

program Len

var

s, x1, y1, x2, y2: integer;

begin

writeln(' x1,y1');

readln(x1, y1);

write(' x2, y2);

readln(x2,y2);

s =sqrt((x2-x1)*(x2-x1+(y2-y1)*(y2-y1);

writln(': S =,s);

Readlm

Readln;

End.

 

 

:

1. Borland Pascal.

2. , .

3. File.

4. Edit.

5. Search.

6. Run.

7. Compile.

8. Debug.

9. Options.

10. Window.

11. .


2.

 

: Pascal: , -, , .

:

¾ ;

¾ ;

¾ - ;

¾ .

 

:

1. , , .

2. .

3. : [4: 4], [7: 1 - 3], [9: 1], [10: 3].

4. ;

5. .

 

: 4 5 1 3.

 

:

- ;

- , var;

- , ;

- Pascal integer () real ();

- (:=) , ;

- , , , ( Type miss match ;

- write writeln ;

- writeln ;

- ( ) read readln;

- , , Error: invalid numeric format;

- , {..} .

 

:

1. :

Byte   0... 255
ShortInt   -128... 127
Word   0... 65535
Integer   -32768... 32767
LongInt   -2147483648... 2147483647

 

:

1. "+" - ;

2. " * " - ;

3. " - " ;

4. div - ;

5. mod - .

2. :

, . , , Real, 6, 2.9-39 1.7+38 11...12 .

: .

, . , 27.9, 5.00

mEp, m - ; E - ; p - 10. , , 3,65*10-5 3.65-5.

 

:

: :
4E -4
0.62E+5
-10.88E12

3. :

abs(x) ()
arctan(x) ( )
cos(x) ( )
sin(x) ( )
exp(x) (ex)
ln(x) ( e)
frac(x)
int(x)
odd(x) boolean
pi p
round(x) round(3.5) = 4
trunc(x) trunc(3.5) = 3
sqr(x)
sqrt(x)

 

 

 

1. (X1,Y1); (X2,Y2); (X3,Y3) . .

 

: S=

:

X1 Y1 X2 Y2 X3 Y3
               
  -4            

:

Program Perimetr_treugoln; { }

Var { }

a,b,c, { }

x1, y1, x2, y2, x3, y3, p:real; { }

Begin { }

Writeln( x1, y1, x2, y2, x3, y3);

{ }

Readln(x1, y1, x2, y2, x3, y3); { }

a:=sqrt((x2-x1)* (x2-x1)+ (y2-y1)* (y2-y1)); { }

b:=sqrt((x3-x1)* (x3-x1)+ (y3-y1)* (y3-y1));

c:=sqrt((x3-x2)* (x3-x2)+ (y3-y2)* (y3-y2));

P=a+b+c; { }

Writeln(P); { }

Readln;

Readln; { }

End. { }

 

2. , .

 

:

Program Srednee;

Var

A,b:real;

Begin

Writeln(' - a, b');

Readln(a,b);

Writeln((a*a*a+b*b*b)/2);

Writeln((a*a+b*b)/2);

Readln;

Readln;

End.

3. , .

 

:

Program Summa_cifr;

Var

a, x, S:integer;

Begin

Writeln(' ! ');

Readln(x); { X=432. }

S:=0; { !}

a:=x mod 10; {a=2}

S:=S+a; {S=2}

x:=x div 10; {x=43}

a:= x mod 10; {a=3}

S:=S+a; {S=5}

a:=x div 10; {a=4}

S:=S+a; {S=9}

Writeln(' S= ',S); { : S= 9 }

Readln;

Readln;

End.

 

 

1. , .

2. , , .

3. . , , , , .

4. A,B c, ; C, a,b.

5. , .

6. R1, R2 R3 . .

7. X Y.

8. x=>y, y=>z, z=>x.

9. 4- . 2-, .

10. . , . .

11. , .

12.

***** S = (x + y) / 2 =12 *****

 

13.

+**********************+

| *** _______ *** |

+**********************+


3.

: .

 

:

¾ if;

¾ ;

¾ ;

¾ .

 

:

1. , , .

2. .

3. : [2: . 126 - 128], [4: 2.4, 5], [7: 5], [9: 4].

4. ;

5. .

 

: 4 5 1 3.

 

:

- if ( , );

- , : true ( ) false ( );

- nd ( "") or ( "") .

- , .

 

, , ( , ) . .

 

program Primer;

var a, b:real;

i, j:integer;

begin

a:=6.2;

b:=4.5;

if a>b then

begin

i:=2;

j:=8

end

else

begin

i:=6;

j:=3

end;

writeln('i= ', i, ' j= ',j)

Readln;

Readln;

end.





:


: 2017-02-28; !; : 402 |


:

:

, .
==> ...

1511 - | 1279 -


© 2015-2024 lektsii.org - -

: 0.162 .