Вы находитесь на странице: 1из 12

PASCAL

( Turbo PASCAL)


1.
2.
3.
4.
5.
6.
7.

.
.

.
Ctrl+F9.
, .
Alt+F5.
F2.

" "

F1

F2

F3

Alt+ F3

Alt+F5

Ctrl+F5

(Shift + )

F6
Shift+F6
F10
Ctrl+F9
F3

Alt+F5

Ctrl+
Break

Esc
Alt+

Ctrl+Shift


( 1
9)
( ),
( )

Shift +
Shift+Del
Ctrl+Ins
Shift+ Ins

Ctrl+Del

,
.

Ctrl+Y

, .

Alt+BackSpase

PASCAL

1.
2.
3.
4.
5.

;
- ;
0 9;
- +, -, /, *,=,<, >, <>, <=, >=;
( ) [ ] { } ; . , _% & # . .


.
- ,

. :
And, file, not, string, else, begin, for, of, then, case, function, or,
type, const, goto, to, mod, div, procedure, until, do, if, program, var,
downto, in, while.

, , , ,

,
, .
1.
2.
3.
4.
5.
6.
7.
8.


()
,
_.
.
.
_.
.
. 63
,
, .

Temp_
_1_2_3
Temp-

:
x1 _33name
My_Variable
:
1x
33name1_2_3
My Variable

():

.
- (
).

:= ;
A:=3*4.8;
Su:=X+X*4.78;
C:=C+1;
.
3 3*
():
sinx sin(x)

Read ( );
Readln ( );
:
Read (I, j);
Readln (k);
Read Readln
,
.
.
ENTER.
Readln Read ,
.


Write ( );
Writeln ( );
,
. Writeln
.
:

i=1, j=2, k=3


l=4, m=5, n=6
:
Write (I, j);
Writeln (k);
Write (l, m, n)
:
123
456


, ,

. :
Writeln (x:8,y:5)

. .
.

-
, : ,
, , .
.
:
(),
,
.

.
const,
, = .
; :
Const
h=3;
b=-7,5;
c=abcde;


. var,
, , ;
, :
var

a,b:real;
c,d:integer;

Var

Var i, j, k : integer;
x, y, z : real;
n, l, m : byte;
t : String;

1.
2.
3.
1.
2.
3.
4.

Byte

0 255

1 ,

Shortint

128 127

1 ,

Word

0 65535

2 ,

Integer

32768 32767

2 ,

LongInt

2147483648 2147483647

4 ,

1 4
:
var
a,b:byte;

f:word;

Single


(1.5 453.438)

Real

( )
(2.9 391.738)

Double


(5.0 3241.7308)

Extended


(3.4 4932114932)

10

,
(12.05, 0.123)
(1.205+1, 1.23-1)
:
1. .
2. + .
3.

:
62.05 = 6.205101 =6.205+1
0.000005 = 510-6 = 5-6
0.00025=0.2510-3 =0.25-3=2.5-4 = 25-5

-4,6
0,0005
4,8*104
100000000

-4.6
.0005
4.84
18


:
1.5822
.002437+5
724900-3
1.582102 = 158.2
0.002437105 = 243.7
72490010-3 = 724.9
4 10 .
, :
:

: 4.12, 6.05, -17.5489

: -3.2-6 (-3.210-6), -6.42+2 (-6,42102)


:

var
a,b,:real;
d,f:double;
k:single;

,
.

( ASCII)

!
1
A

33
49
65


Char

String

1 255

1 .
char .
.
865
%
5
:
var
a,b,:har;
d:String;

() 1 2
: true () false ()
:
1 0

(True) (False)
Boolean

True False

1
boolean.
.
865
%
5
:
var
a,b :boolean;

,
, Write Writeln
.
:
:
:5
:
: :
:6:2


Program Ploshad;
Uses Crt;
Var a,b,s: real;
Begin
Clrscr;
Writeln( ');
Writeln( a b');
Readln (a,b);
S:=a*b;
Writeln ('S= ', s);
Writeln ('S= ', s:6:2);
Readln;
end.

,
1. ;
2. PASCAL;
3. ;
4. .

W X, Y,
Z. X, Y, Z Readln.
2. . ,
. :
.
:
? ->
1.

? -> 1.50
? -> 5
- . : 7.50
? -> 10
: 2.50

;
;
DIV, MOD;
C ;
.

.
: , , ,
.

5 * 2 = 10

4 / 2 = 2.0

5+2 = 7

5-2 = 3

.
: DIV MOD

A DIV B

integer

integer

11 DIV 3 = 3

A MOD B

integer

integer

11 MOD 3 = 2

DIV MOD :

DIV MOD , ,
, .
:
- .
.
.
:
i - ;
j ;
k - ;
s .
Program MyNamber;
Uses Crt;
Var a, i, j, k, s: integer;
Begin
clrscr;
Writeln ( 3- );
Readln (a);
i:=a div 100; { }
j:=a div 10 mod 10; {}
k:=a mod 10; { }
s:=i+j+k;
Writeln ( ,a,=,s );
Writeln (k, j, i);

Readln;
End.

abs (x)

Integer
real

Integer

|x|

arctan (x)

--

Real

arctg x

cos (x)

--

--

cos x

sin (x)

--

--

sin x

exp (x)

--

--

ex

ln (x)

--

--

ln x

sqrt (x)

--

--

sqr (x)

--

--

x2

abs (x)

Integer
real

Integer

|x|

arctan (x)

--

Real

arctg x

cos (x)

--

--

cos x

sin (x)

--

--

sin x

exp (x)

--

--

ex

ln (x)

--

--

ln x

sqrt (x)

--

--

sqr (x)

--

--

x2