:

;

;

( : ; , . );

.

.

: *, /, -, +, div, mod

(a div b) b (a mod b) , b.

(,b-).

a div b= [image] a mod b =a-((a div b)*b)

17 div 3 = 5 17 mod 3 = 2 8 div 2 = 4 8 mod 2 = 0 1 div 5 = 0 1 mod 5 = 1

:

  1. a b a*b;

  2. n/-2 n/(-2);

  3. : ;div, mod; *, /; +, -;

  4. .

.

(63 ).

.

Shortint - (1 ). (-128 [image]127)

Longint - (4 ). (-231[image]231-1)

Integer - (2 ). (-32768[image]32767)

Word - (2 ). (0[image]65535)

Byte - (1 ). (0[image]255)

: Maxint = 32767 (215-1) Maxlongint = 231-1

.

Boolean - (1 ) 2 :

True ()

False ()

. 2 :

(=)

(< >)

:

False< True

:

And ()

Or ()

Not ()

Ord (false) = 0 Ord (true) = 1

.

Chor - (1 )

(, , , , ). - , 9.

.

String - (255 ).

[image] .

.

Real - (6 )

(11 ).

:

0,5; +5,0; -133,15

1200 = 120,0 +1 = 12,0 +2 = 1,2 +3 = 12000,0 -1 ( [image]38)

.

.

[image]sin (x) sin x (.)

cos (x) cos x (.)

arctg(x) arctg x (.)

exp (x) ex (.)

ln (x) ln x (.)

pi (x) 3.14 (.)

abs (x) [image] (.)

sqr (x) x2 (.)

sqrt (x) [image] (.)

trunc (x) , . ()

trunc (3.7) = 3 trunc (3.1) = 3 trunc (-3.7) = -3

frag (x) (.)

int (x) (.)

int (3.4) = 3 int (3.7) = 3 int (-3.4) = -4

round (x) ( -) (.)

round (3.14) = 3 round (3.74) = 4 round (-3.14) = -3

random (x) (.)

0 x; x , 0[image]1

odd (x) TRUE, x - (.)

, , , . .

. .

, , :

program <>;

< >;

< >;

begin

< >;

end.

:

program ;

begin ;

end .

<> - ( ).

.

, .

var .

program ff;

var

i, n: integer; x,y,z: real;

begin;

.........

end.

:, ;, ,.

: label.

: const.

: type.

.

, , . ;.

:

;

;

.

:

begin

< 1>; < 2>;

end;

.

.

: = .

<> : = <>;

[image][image] .

:

[image]; [image] [image]

. , - ().

, .

-.

READ (< - >)

;

, .

WRITE (< - >)

;

, .

READLN (a, b, c) - a, b c .

WRITELN - .

WRITE .

Writeln ( _ a = , a:8:3, _ b = , b:4);

a = 341.154, b = 2

_ a = _ 341.154 _ b = _ 144

a = 1.3, b = 144

_ a = _ _ _ 1.300 _ b = _ 144

Program _ prim;

lrscr - ;

var a, b: integer;

x ,y: real;

begin writeln ( a, b );

readln ( a, b);

x: = a + b; y: = a/b;

writeln ( x = , x:8:3, _ _ , y = , y:8:3)

end.

, .

.

. , .

label N1, N2 ;

.

N1, N2, - () (0[image]9999).

: GO TO N; - N.

program pr;

label 3;

var

x, y: real;

begin

3: readln (x, y);

go to 3;

end.

: IF < > THEN P1 [ ELSE P2 ]; ( )

<> - ;

P1, P2 - .

:

<> - "", P1 (true);

- " ", P2 (false).

ELSE - <> - "", .

:

IF a>b THEN write (a) ELSE write (b).

:

Y =[image]

If x>=0 then y:= sin(x) else y:= - sin(x);

, : AND () OR () NOT (). [image]

IF (a>b) and (a>c) THEN writeln (a = , a)

IF a<0 THEN

[image] (P1)

ELSE

[image] c (P2)

IF.

IF n>0 THEN

IF ( m div n)>n THEN

m: = m-n

ELSE

m: = m + n;

ELSE - IF.

n>0 (m div n)>n m: = m-n.

n>0, (m div n)[image]n m: = m + n.

n[image]0 - .

:

: y=[image]

Program fun;

var

x, y: real;

begin

writeln ( x); readln (x);

if x>90 then writeln ( )

else begin

if x<0 then y: = 0

else y: = SIN (x*PI/180);

writeln (y = ,y:8:3);

end; ( )

end.

CASE OF; IF.

:

CASE N of

N1: P1;

N2: P2;

NN: PN;

[else P;] - .

end;

N - , .

N1, N2, NN - N.

P, P1, P2, PN - .

:

- N = N1, P1 ( case ... of);

- N = N2, P2, P.

else - N - , case of .

.

, , .

.

:

;

;

.

FOR i: = N TO K DO P

() () ()

i - ;

N, K - ;

P - ;

I, N, K - .

i - 1.

K<N, .. : (-1)

FOR i: =N DOWNTO K DO P

.

S= 1+1/2+1/3+ +1/50

- Sum. . , , . Sum = 0.

Program sum;

Var

i: integer;

sum: real;

begin

sum: =0;

for i: = 1 to 50 do

Sum: = sum + 1/i;

Writeln (" = ", Sum);

end.

for , +1, -1.

.

REPEAT

[image] -

UNTIL <>;

P1, P2, PN - .

" ", <>, , . , <> .

: <> , .

: y = a sin (x ) , x = [image], [image][image]=0.2

program fun;

var

y, a, x: real;

begin

x: =0; read (a)

repeat

y: = a *sin (x); writeln (y, x); x: = x + 0.2;

until x>1;

end.

, , .

.

WHILE <> DO P;

P - .

<> , , - P, <> . .

, P - , <>.

, P - , .

: y = sin x, x[image], x[image], [image] - .

.

Program cikl;

var

y, x, x k, d x: real;

n, k: integer; SP, n - .

SP, S0: real; S0, k - .

begin

writeln (" x - , x - , d x - ");

read (x, x k, d x);

SP: =0; S0: = 0; n: =0; k: =0;

While x< = k x do.

P [image] .

if n=0 then writeln (" ")

else writeln (" = ", SP/n);

if k=0 then writeln (" ")

else writeln (" = ", S0/k);

end.

1:

.

Program sum-prois;

uses crt;

const

n = 100;

var

a: array [1n] of real;

n, k, i: integer;

p, s: real;

begin

clrscr; s: = 0; p: =1;

writeln (" "); readln (nk);

writeln (" ");

for i:=1 to nk do

readln (a[i] );

for i:=1 to nk do

begin

s:= s + a[ i ];

p:= p * a[ i ];

end;

writeln (". = ", s, ". =" , p);

end.

:

- s=0

- p=1.

100 (n=100).

(nk).

. for .

.

.[image].

:

a - ;

n, m - .

- n[image]m.

a[i, j] - i- j- .

.

a[i, i] - .

a[i, 2] - .

1.

.

Program matrix;

const

n=10;

m=10;

var

a: array [1n, 1m] of real;

i, j: integer; n, m: integer;

s: real;

begin s:=0;

writeln (" m, n);

readln (n, m);

{ :}

for i:=1 to n do

for j:=1 to m do

readln (a[i, j]);

for i:=1 to n do

for j:=i to m do

s: s+a[i, j];

writeln("s=", s);

end.

.

i - ;

j - ;

i - j.

.





1. -

2.

3.

4.

5. 2008 2009

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

,