(Boolean) : TRUE FALSE. 1 , 1, TRUE, 0 .

, Const r = TRUE;

Var a: Boolean;

, .

, . , , .

- , .

, , 4. .


4 -

.


:




:

































 

 

 

 


1

Pascal

1.1 Pascal, .

2.1 .. : / . . .. . - .: : -, 2006.

2.2 .., .. : . .: ; ; , 2008.

2.3 .

3.1 .

3.2 .

3.3 IF...THEN...ELSE....

3.4 1 .

4 :

4.1 .

5.1 ( . 1).

5.2 .

1 1

  1) = .
2) , . . : , .
3) ( 1), . 1  

 


1

  1) = .
2) . , . : , .
3) ( 1), . 1

6 :

6.1 1 .

6.2 .

6.3 .

6.4 6.1 6.4 2 3.

7.1 .

7.2 .

7.3 .

7.4 Pascal.

7.5 .

7.6

8.1 Pascal?

8.2 Pascal?

8.3 Pascal?

8.4 Pascal?

8.5 ?

8.6 Pascal?

8.7 Pascal?

8.7 Pascal?

8.8 ?

8.9 Pascal? ?

Pascal :

;

;

;

,

;

;

;

.

:

Program ;

USES

{ }

Label

( )

Const

{ }

Type

{ )

Var

{ }

{ }

Begin

{ }

End.

 

,

 

Program Example_1;

Var a,b,rez: Integer;

Begin Writeln( );

Readln(a,b);

rez:=a*b;

Writeln( , rez);

Writeln( <Enter>);

Readln;

End.

, .

.

Program . , , , .

. Var, . , . , .

, Begin, . END, .

, , , , ; , . . , , . (, , , , .).

:

2

,
Shortint -128...127  
Integer -3276832767  
Longint -2147483648...2147483647  
Byte 0...255  
Word 0...65535  

, Const r = 4;

Var a: Integer;

b: Longint;

c: byte;

, (, 3,14 =.314+01, 10-3 = 1-3).

. .

3

,
Real 2.9-39... 1.738 11-12  
Single 1.5e-45... 3.438 7-8  
double 5.0-324... 1.7308 15-16  
extended 3.4e-4932...1.1e4932 19-20  

 

, Const r = 4.0;

Var a: Real;

b: double;

2 , :

 

Round(x) ;

Trunc(x) .

 

, Round(3.456) = 3

Round(5.678) = 6

Trunc(3.456) = 3

Trunc(5.678) = 5

+
. .
-
. .

4

 

*
. .
/ . .
div 25 div 6 = 4
mod 25 mod 6 = 1

 

( 5).

 


5

 

-
pi - . = 3,1415926536+00
abs(x) . .
sqr(x) . .
sqrt(x) . .
arctan(x) . . ()
cos(x) . . ( )
sin(x) . . ( )
e() . .
ln(x) . .
frac(x) . .
int(x) . .

 

5, . , lg(x), tg(x), ax. , 6.

 


6

 

4 sqr(sqr(x))
5 sqr (sqr(x))*
, > 0 sqrt(sqrt(x))
, > 0 e(* ln(x))
, > 0 e(1/n* ln(x))
lg(x), > 0 ln(x) / ln(10)
, a > 0, a ln(x) / ln(a)
ax e(* ln(a))
tg(x) sin(x) / cos(x)
ctg(x) cos(x) / sin(x)

 

, div mod, .

. , , . . . , , . .

, , , .. .

- , .

TRUE () FALSE ().

, ( ), .

. , , , .. , .

7.

 

7 -

 

=
<>
<
<=
>
>=

 

, .

. , . . 8.

 

8

 

not x x and y x or y x xor y
False False True False False False
False True True False True True
True False False False True True
True True False True True False

(=, <>, <=, <=, <, >) , , . , (a>0) and (a<max).

. :

:= ;

: , , , .

, m:= 5;

i:= i + 1;

, m 5, - i .

: Read Readln ( ), Write Writeln ( ).

Write . Write . , .

,

Write (summa);

Write ( );

Write ( , rez);

Write ( , , , , , rez);

() .

, ( ).

, Write (summa: 5);

summa 5 . , , , .

, . , , . , , . , , , ( 17 ).

, 9, (_).

9 Write

m
  Write (m);  
  Write (m, m, m);  
  Write (m: 7); _ _ _ _ _56
  Write (m: 5); _ _ _56
715.432 Write (m) _7.1543200000+02
-1.919+01 Write (m) _-1.9190000000+01
531.04 Write (m: 15) 5.310400000+02
46.78 Write (-m: 12) -4.67800+01
513.02 Write (m: 8: 4) 513.0200
-86.78 Write (m: 7: 2) _-46.78

 

Write , , . Write . ,

rez:=8;

Write ( );

Write ( );

Write (rez);

: 8

Writeln Write , . ,


rez:=8;

Writeln ( );

Writeln ( );

Writeln (rez);

:



<== | ==>
 |
:


: 2016-12-17; !; : 797 |


:

:

.
==> ...

1507 - | 1433 -


© 2015-2024 lektsii.org - -

: 0.059 .