[̲] [] []

 

7.

7.1.

7.2.

7.3.

7.4 ᒺ

7.5. ᒺ

7.6.

7.7.

7.8.

7.8.1

7.8.2

7.8.3

7.9.

7.10

 

7.

 

, . , , : , , .

- , . , , , .

. t, , . t - , Dt t , , . Dt Dt.

 

: Dt t,

 

f: D * D *. .. * D -> D

t1 t2 tn t

 

 

: D * D *. .. * D -> D, * D, *. .. * D,

t1 t2 tn t1 t2 tn

 

 

f: t1, t2,. .., tn -> t (7.1)

 

: t1, t2,. .., tn -> t1, t2,. .., tn, (7.2)

 

(7.1) f, (7.2) .

 

ϳ t t1, t2,..., tn, :

 

         Dt Dt1, Dt2, ..., Dtn;

         , , , Dt.

 

, , t1, t2,..., tn , , , .

 

7.1.

 

t - ( - ), Dt - .

---------------------

ts = t

L--------------------

 

- , Dts Dt.

,

;

;

1..n.

 

7.1. t=n, t=2n.

 

, , , . , - ts, t.

1. :

-

 

[_.._, _.._, ..., _.._]: t, t, ..., t -> ts;

 

s1, r1, ..., sn, rn - t, [s1..r1, ..., sn..rn] , d Î Dt, sk < d < rk k=1,..., n; s..s s, []. , t - . , ,

 

<- ['a'..'z'].

 

- '

 

_+_: ts, ts -> ts,

 

, + +[];

 

-

 

_*_: ts, ts -> ts,

 

, *;

 

-

 

_-_: ts, ts -> ts,

 

, A-B -[].

 

2. :

 

-

 

card: ts -> ,

 

, card()=.

 

3. ³:

 

-

 

_ _: t, ts -> ,

 

, ;

 

-

 

_=_: ts, ts -> ,

 

, =;

 

-

 

_<_: ts, ts -> ,

 

< , .

, :

 

<> = Ø(=);

<= = (<) V (=);

> = B<A;

>= = B<=A.

 

4. :

 

- <- , - t;

 

-

 

 

,

 

{ =0 <> [] }

{ Ø( ) & =0+[] },

 

;

 

-

 

,

 

- , , ( - )

 

B <- ;

card()>0

;

.

 

- Set(t) , t.

 

̳ = (, , , , , , , , , , , );

, , : ̳

 

-

 

<- [.., ..];

<- [, ];

<- [, ].

 

- , Set(t), .

- -. , , , , ,

 

Get_Set ( : t)

N: ; X: t;

(N); <- [];

N

(X); <- +[X]

.

 

.

7.1. .

 

Length_Month (M: ̳):

Short: ̳;

Short <- [, , , ];

M= Length_Month <- 28

M Short Length_Month <- 30

Length_Month <- 31

.

 

7.2. .

 

axI_Set (: n..m):

K, J: n..m;

K <- n;

J

J>K K <- J

;

MaxI_Set <- K

.

 

7.3. .

 

PrintI_Set ( : n..m)

K: n..m;

card()>0

K <- MaxI_Set (); (K);

<- -[K]

.

 

. , Q - : t -> .

 

Search_Set ( : a..b;

X: a..b; Find: )

Exhaus: ;

X <- a; Exhaus <- X>b; Find <- ;

Ø(Exhaus V Find)

X Find<- Q(X) ;

ØFind

Exhaus <- X=b;

ØExhaus X <- succ(X)

{ Find Q(X) "(X Î ) ØQ(X)}

.

 

7.1. , , b , b .

 

г , , Set(t) Set0(t), . .

, ,

 

{ < [a..b]}

X <- a; Exhaus <- X>b;

ØExhaus

X ;

Exhaus <- X=b;

ØExhaus X <- succ(X)

.

 

7.2. 7.1.

г .

7.4. ( 276-194 . ..). , n.

 

Erat (N: ): 2..N

I, J: 2. N;

, R: 2..N;

R <- [2..N]; <- [2];

I<-2 N 2

R <- R-[I]

;

I<-3 N 2

I R

<- +[I]; R <- R-[I];

J<-I*I N 2*I

R <- R-[J]

;

Erat <-

.

 

7.2.

 

ѳ .

 

 

type Name = set of t,

 

Name - ' ; t - - - , real. t .

 

:

 

[] - ;

[2,3,5,7,11];

['a','o','i','e'];

[1..1, 5..1] - [1].

 

, , .

 

256. 1 '. 񳺿 32 ' . - , i- i- .

:

+: ' ;

*: ;

A-B: - , .

 

³:

z in - z ;

= - ;

<> - ;

<= - Î ;

=> - Î .

 

:= , - , .

 

1P. , 255 ( 7.4):

 

program ERAT255;

const N= 255;

type Set255= set of 2..N;

var P: Set255;

I, J: 0..N;

procedure Erat (var P: Set255);

var R: Set255;

I, J: word;

begin

R:= [2..N]; P:= [2]; I:= 2;

while I<=N do begin

R:= R-[I]; I:= I+2

end;

I:= 3;

while I<=N do begin

if I in R then begin

R:= R-[I]; P:= P+[I];

if I<=N div I then begin

J:= I*I;

while J<=N do begin

R:= R-[J]; J:= J+2*I

end

end

end;

I:= I+2

end;

end;

begin

Erat (P);

J:=0; writeln(' [1..255]');

for I:=2 to N do

if I in P then begin

write(I:4); J:=J+1;

if J mod 10 = 0 then writeln

end;

writeln

end.

 

[̲] [] []