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

-

..

PascalABC.NET

2011

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

681.142(07)
.426.24/29
64

..
PascalABC.NET: . : . . -., 2010. 114 .
,
Object Pascal PascalABC.NET.
, ,
, ,

.

(, ,
, ) , ,

. ,
. ,

,
.


- , 2010
.., 2010

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


................................................................................................................................................................. 5
1. PASCALABC.NET ............................................ 7
2. ............................ 12
3. ................................................................... 17
4. ( ) .................... 19
5. ............... 23
6. ................................................................................ 26
7. ....................................................................................... 29
8 ................................................................................... 32
9. ......................................................................... 34
100 ........................................... 37
11 : ............................... 39
12 .................................. 43
13 .................................................................................. 49
14. ..................................................... 52
15. . .................................. 55
16. ......................................... 58
17. .............................................. 59
18. .................. 61
19. ................................................................... 64
20. : ............................... 67
21. ...................................................................... 72
22. ..................................................................... 74
27. - ........................ !
.
28. :
............................................................................................................... ! .
29. ..................!
.
30. .....!
.
3

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

31. ....................................... ! .
32. ......................... !
.
33*. ....... !
.
34. , ... !
.
35. . .................... !
.
................................................................................................. 76

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


.
,
(
). , , . . , ,
, .
, MS Office
VBA (Visual Basic for Applications),
; 1 .
, ,
, IT-.
. ,
, , .
.

( : Object Pascal), c (..
), - , (..
) -
.
. : , , , .
PascalABC.NET ( ), , Examples. , ,
(Turbo Pascal, Borland Pascal, Free Pascal, TNT Pascal
..), .
http://PascalABC.NET/.
Borland Pascal,
PascalABC.NET (, ,
. . . . ,
). :

5
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

1) - ( Borland Pascal) DOS, ..


MS DOS, Windows , , , - ;
2) PascalABC.NET, , Delphi,
;
3) PascalABC.NET Delphi;
4) PascalABC.NET
;
5) ,
.
:
;

*
**

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

6
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

1.
PascalABC.NET
1. PascalABC.NET
.
1
. , .
Pascal, .
.
\Examples
.
1.1.
2
PascalABC.NET (
PascaABC.NET PascalABC.NET).
, (. 1).



( )


(
)

. 1. PascalABC.NET

3
, . 1.

7
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, .
,
, ( . 1 ). ,
( ).
, , ( ), , .

1.2. .
, , .
1.2.1.
4
demo0.pas, demo1.pas, demo2.pas, colors.pas
. ( )
: ,
.
,
. .
5
demo0.pas. :
) .
demo0.pas
;
) ;
) ,
(. 2).
, .
.
1.2.2.
6
.
(
), ,
.
7
demo2.pas. .
, .
.
8
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

( ),
.

().

. 2. ,

, .
8
olors.pas. ,
.
, .
1.2.3.
,
, .
(.. ), , ,
.. , .
9
. , .
1.2.4.
. .
,
Program1.PAS. , 9
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

(.. ),
Program2.PAS ..
10
. :
Program ex0;
Begin
Write(' ')
end.

.
.

, -
.

1.3. PascalABC.NET
, . ,
( , ),
, , ,
, , .
? , , ,
.
PascalABC.NET.
PascalABC.NET, .
() ( ).
. PascalABC.NET .
.
, (.. ,
) .
. , , , , .
11
.
, , ,
( FirstPrg.pas) .
12
demo0.pas, demo1.pas, demo2.pas
. .
10
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, ()
.
13
(Examples\ \index.html).
"".
. .
2.
1.
2.
3.
4.
5.
6.
7.

PascalABC.NET?
? ?
?
?
. -
?
, - ?
?
()
?
,
.
.
PascalABC.NET.
, ( ).

11
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

2.

1.
:
program <>;
< >
Begin
< 1>;
< 2>;
...
< N>
end.

;
;
() ;

:
1) () ;
2) END ;
3) BEGIN ;
4) END .
2.
2.1.
, , . : ,
.
, ,
. VAR:
var num : integer; num,
( -2147483648 2147483647.).
integer ()
( ) , .
, num
integer ( ). . . , , .
- / ,
. : _
12
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, ,
!
, , (
: , ):
Program, begin, end, var, integer.

! VAR
() .
!
(..
) :
integer
byte
word
real
char
string

-2147483648 2147483647;
0 255;
0 65535;
;
Unicode ( 2 );
.

2.2. ,

: , . :
(1) ,
. : 345 , -12222 ;
(2) :
: -123.234, 92929.3456 ( ,
, ),
( :
). , 1,231012
:
1.23+12
+12 ;
(3) ,
:
. ... 2+2=5

. :
< ><>

13
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

:
(:=),
!
1.

program example1;
var num : integer;
day : byte;
name : string;
begin
num355;
day31;
name

{ }
{
}
{
0 255}
{ }
{ num 355}
{ day 31 }
{ name }

end.

, .
() .
2.
program
example2;
var
num
:
integer;
day : byte;
Begin
num355+145; { num 500}
daynum -469; { num
(500) end.
(31)}
: , .
, , , .
2.3.
, , , .
.
. , 1 WriteLn.

,
. , PascalABC.Net
.

14
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

14
lab2_14.pas. .
.
15
lab2_15.pas. .
.
16
lab2_16.pas. .
17
lab2_17.pas.
.
WRITE WRITELN.
2.4.
.
. .
WriteLn (Write)
, . .
18
lab2_18.pas. .
.
, 20, 30 40 .
19
lab2_19.pas. .
.
, : 2
, .
20
lab2_20.pas. .

. ,
: 133.567, 20 5
; 79954.23451 ,
, .
21
lab2_21.pas .
22
lab2_22.pas .
15
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

23
, ,
, , ,
-. .
writeFormat.pas
.
.
PascalABC.NET. , ( ).

16
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

3.

24
(Examles\\index.html)
.
. .
1.
. , .
READLN. :
READLN(< >)

:
var fantom : integer;
story :string;
begin
...

Write( :);
ReadLn(fantom);
...

WriteLn( :);
ReadLn(story);
...

end.
25
lab3_25.pas. .
. ,
. READLN.
26
lab3_26.pas. .
.
27
lab3_27.pas. .
.

!
.
28
lab3_28.pas.
, . , ,
17
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

N ,
P .
29
lab3_29.pas.
.
PascalABC.NET.
3.
1. , . ,
, .
2. . ,
, .
3. , .
4. , : ()= () 100.
5. 18%.
. .
6. . .
7. 15% . .
8. p . . : 1 = 500 , 1 = 3 , 1 = 16 , 1 = 44,45 .
9. , .
10. , , . . :
: .

11. , , ,
.
4.
1. ?
2. ?
3. ?

.
PascalABC.NET. .


, ( ).
18

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

4.
( )
, () PascalABC.NET . ,
. , ( ), GraphABC.
. (.. ).
. ,
,
.
1. GraphABC

(.. - ) ( ),
. , , GraphABC ,
.
Uses.
GraphABC,
.
2:
Program <>;
Uses GraphABC;
...

,
.

30
GraphABC (
GraphABC). GraphABC:
. ,
, .
GraphABC: (
) GraphAB: ( , , ..).

,
.

19
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, ,
, . . , ,
(. 3).

0,0

. 3.

.
,
Y , (. 3)!
31
lab4_31.pas.
. .
, :
) ;
) ;
) : ,
.
32
lab4_32.pas.
,
( ).
,
. :
) ;
) .

,
( WriteLn)
, .
WriteLn.

20
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

33
lab4_33.pas
, .
. ,
, .
: , ,
:
) ;
) .
34
:
) 300200 ( : , ,
- );
) 300200 ; ( : , ,
- );
) 300200 (
).
35
:
) ;
) ;
) ,
, .
36*
,
, . , , ..

GraphABC
(
GraphABC).

3.
, :
1) (). ;
2) .
TextOut. , 26 , ;
3) . ,
, , 5 , ;
;
21
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

4)
5)

,
:
,
250250 :

6)

5 , ,
150150 :

7)

,
. 5 , ,
, , .
250150 .

8)

.
200200 , clGold, MoveTo LineTo.

.
PascalABC.NET. .
, ( ).

22
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

5.

37
, .
:
a) lab5_37.pas ;
) ;
) ,
.
38
,
. :
a) lab5_38.pas;
) ;
) ;
) ,
. :
. :
120000
:
10
1:
15
2:
17
10 1
135000
10 2
137000
39
, .
:
) lab5_39.pas ;
) ;
) ,
(,
:

p ( p a )( p b)( p c ) ,

p , a, b, c );
) , .

1. , :
) , .
30 ;
) ;
23
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

) -

;
) .
2. . .
3. , , ,
.
4. (10, 15 ). , (
, 15 ), ,
, 15% .
5. . 2,54 . , .. ,
. , 21 = 0 53 3,4 .
6. .
,
,
.
a : y=ax.
:
ln y = ln ax ln y =x ln a. : ln y =x ln a
y =x ln a. : y:=exp(x*ln(a)).
, . . ?
7. , . :
= X 7,
X = abs(trunc(2.6*m-0.2)+d+y/4+y+c/4-2*c);
m - (. );
d - ( );
- (. );
- .
( 1582 4903
). -, ,
1 . ,
1, 2, ..., 11 12,
. ,
1 1991 12, 1990,
31 1991 - 10, - 1991.
0 6, 0 .
24
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

.
PascalABC.NET. . ,
( ).

25
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

6.

40
(Examles\\index.html)
, .
.
.
1.
, , .. ( ) ,
, . ,
, . ,
, , , .
( , IF).
2. IF
41
PascalABC.NET. ,
, ,
.
.
42
PascalABC.NET. lab6_41.pas.
.
.
?
, :
!
.
43

. :
7. ,
.
44
1. ,
.
26
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

2. (
). ?
.
3. .
4. lab6_43.pas.
, , .
. ,
. (
,
,
.)
45
1. lab6_44.pas.
2. .
.
3. , ,
(, ,
), .

1
, (
, , .
: , ,
).
2
, :
) ;
) ?
.
3
,
( +=0). :
, , (
).

1. , , (x,y) R .
2. , ,
() (x,y).
. ,
.
27
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

3. , , (x,y) y=1-x. , ,
.
4. . , , .
5. ,

.
6. . ,
, 9.
7. . ,
.
8. : b. , ,
. ?
9. . , ,
.
10. , 4,
100 400 (, 1700, 1800
1900 , 2000 ). ,
, .
11. , ,
.

.
PascalABC.NET. .
,
( ).

28
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

7.

1.
,
,
, . ,
,
:

Write( = ); Readln(n);
If n=1 then writeln() else
if n=2 then writeln() else
if n=3 then writeln() else
if n=4 then writeln() else
if n=5 then writeln() else
if n=6 then writeln() else
if n=7 then writeln()
else writeln( );

, , .
( CASE).
46
(Examles\\index.html)
CASE. .
.
2. CASE
47
PascalABC.NET. ,
, ,
. .
48
1. lab7_48.pas. . , .
2. ,
0 (clBlack),
8 (clPink).

29
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

49
,
(+ , - , * , /
) .


char.
50
, ,
.
51
, ,
( 3 , 4
7 , 7 , 15 20
.. ).
52*
, 12
:
20.1 - 18.2
23.7
- 22.8
19.2 - 20.3
23.8
- 22.9
21.3 - 19.4
23.9
- 22.10
20.4 - 20.5
23.10 - 22.11
21.5 - 21.6 23.11 - 21.12
22.6 - 22.7
22.12 - 19.1
.

:
100 . , ,
: 120..218.

1. ,
, .
2. , ,
. , , ( . 10
).
3. : 11, 12, 13, 14.
30
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

(, ..). ,
.
4. , (1-5) (1 , 2 , 3
, 4 , 5 ).
5. 10 40, . , , : 18
, 21 .
6. 100 999. ,
, : 145
, 768 .

.
PascalABC.NET. .

, .

31
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

8

53
(Examles\\index.html)
. . .
54
(Examles\\index.html)
: .
PascalABC.Net
, .
, .
.
55
lab8_55.pas.
15 ... ( ,
). , :
) 15, 10 ;
) ;
) , ;
) , ;
) ...
( i).
56
lab8_56.pas
f(x) = sin(x) x = 0, 0.1, 0.2,..., 2.
, :
) ;
) x;
) x = 0, 0.2, 0.4, ..., 3;
) .
57
lab8_57.pas
. ,
:
) ;
) .

32

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

58*
,
( ).

1. , 6 ,
( clRandom).
1. ,
.
2. :
)
)
)
)


.
PascalABC.NET. .

, .

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

9.

, . . , . ?
GraphABC.
.
.
. , , , .
, , .
, , .. ,
. :
( ), , , Rectangle, .
:
MoveTo(X, Y : integer); (x,y);
:
LineTo(X, Y : integer);
(x,y)
;
Line(x1,y1,x2,y2 : integer);
(x1,y1) (x2,y2)
.
:
...
MoveTo(10,10);
LineTo(100,100); { 110,110 }
...


SetPenColor(color: integer); . GraphABC .
(): GraphABC GraphABC: .
SetPenStyle(ps: integer);

ps.
(ps) . . ():
GraphABC GraphABC: .
SetPenWidth(w: integer); , w .

34

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

SetBrushColor(color: integer); , -

color.
GraphABC.
:
uses GraphABC;
begin
SetPenColor(clFuchsia);
{ }
SetPenWidth(10);
{ }
SetBrushColor(ClBlue);
{ }
SetBrushStyle(psDash);
{ }
Rectangle(10, 10, 180, 100); { }
SetBrushStyle(bsSolid);
FloodFill(210, 110, clIndianRed); { }
end.

,
. , ,
clRandom (.. ).
59
PascalABC.NET.
,
(. ). .
LineTo.
.
60
. ,
:
) 500 () 10 ;
) 400 (
);
) N M .
61
: ,
N , K .

3. :
)

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

4. ( )
.
5. .
6. :
)
)
)
)


.
PascalABC.NET. .

, .

36

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

100

1.
(, )
(, , ..).
Random(n : integer) : integer; .

0 n-1,
n .
, :
Random: Real;

0 1.
, .
62
PascalABC.NET.
rnd_62.pas ,
. 2-3
, :
.
63
rnd_63.pas ,
. 2-3
, :
. , .
64
rnd_64.pas , .
, .
rnd_64.pas ,
. ,
.
65
, rnd_64.pas,
,
,
. (.. ,
). !
2.
:

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

PutPixel(X, Y,Color: integer);


X Y
Color (integer ).

, (100,200), :
PutPixel(100,200,clblue);

66
,
.
(.. , ).
67
rnd_67.pas. .
, ,
3 8.

:
;
;
, ;
,
.
.
1. ,
:
) (.. 1 10);
) 1 100;
) 1 100. ,
, ;
) 100. ,
: .. (.. !).
2. , :
) ax=b;
) ax2+bx+c=0.


.
PascalABC.NET. .

,
.
38

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

11
:
68
(Examles\\index.html) : FOR. . , .
.
1.
2.1.
69
PascalABC.NET. :
) lab11_68.pas;
) ;
) (
N 1, 10, 0, -5); ,
);
) , N
.
70
:
) lab11_69.pas;
) ;
) ;
) ,
15 15.
2.2.
71
,
.
) lab11_70.pas:
integer, . ,
(..
0);
) ,
integer int64. ,
;

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

) lab11_70.pas: :
real. ,
.
2.3.
72
N N
:
12 = 1
22 = 1 + 3
32 = 1 + 3 + 5
42 = 1 + 3 + 5 + 7 .
, .
73

.
,
.

, :
1 1 1 1
1
) e = 1+ ... ... ; ( e = 2,718 281);
1! 2! 3! 4!
n!
1 1 1 1
(1) n1

4
(
1

...

...) ( = 3,141 592);


)
3 5 7 9
2n 1

( 1)k
1 1 1
(
2 =2 1 1 1 ... 1
3 5 7
2k 1

2 1,414 213)

2.4.
74

.
, ,
, .
75
,
.
.

40

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

.2.4.
76
N .
,
77

, .
,
.
.2.5.
1202 ,
, :
(
), .
,
?
, , , , :
1,1,2,3,5,8,13,21,34,...
, ,
. , - .
n- F(n), , (.. ,
):
F(1)=1
F(2)=1
F(n)=F(n-1)+F(n-2), n>=3
78
, :
) N ;
) , ; G ;
) ,
;
) . :

( ; , , 10).

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


1.
.
2. p%
. ,

.
3. , ,
.
,
(, 5, 11, 19).
4. ,
N. ,
(, 6=1+2+3).
5. , ,
.
,
(, 5, 11, 19).
6. ( )
: t ,
.
T?
?
7. . ,
,
( ),
(). ,
.
8. . 2n .
( )?
9. ,
, , 10 ., 5 .,
0,5 ., 100 . 100 ?
10. ,
.
, 5.


.
PascalABC.NET. .

,
.

42

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

12

1.
, . :
: (, , ...) . . .
. ;
: (,
, , ,
..), (
), ( )
: , , , ,
(, , , , ), , , .
: , ,
, .
5-50 , .
,
, , . . .
2.
.

, .

1. ()
, - . ,

, .
2.
, Forest(n) (n ), .
:
uses GraphABC;
begin
Forest(25); // - 25
end.

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, PascalABC.NET, , , Forest.
3.
, .
, .

Rectangle(x,y,x1,y1),
SetPenColor(m) .. .
,
.
, :
Procedure < >[(< >);]
< >
begin
<>
end;

.
, ,
, . VAR. :
Program < >; //
< >
< >
< >
< >
begin
<>
end.
79
1. PascalABC.NET. Proc1.pas. . .
2. , .
3. , 15
75 ,
.
44

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

PROCEDURE ( ), , .. , . .
. .
:
Procedure House(x,y:word; name:string; usd:real); 4 (2 , ).
...
Procedure Man(name,adress:string); 2 ().
...
Procedure Girl(name:string; eye:byte; nice:real); 3 (, 0 255, ).
...
Procedure Wait; .
...
80
1. Proc2.pas. .
.
2. ,
pict .
:
...
begin
PICT //
end.
81
Proc3.pas.
TRIANGLE, .

, . , ,
.
4.
, Forest.

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

82
Proc4.pas.
. . ,
. ,
,
( ).
5.
, Fir
(- ), . :
procedure fir(x,y,h:integer; c1,c2:Color);
x,y , h , c1 , 2 . , , .
.
Uses GraphABC;
procedure triangle(x,y,h:integer; c1,c2: color); //
{: x,y , h ;
c1 ; c2 }
begin
//
end;
procedure fir(x,y,h:integer; c1,c2: color); //
{: x,y h ; st c
; c2 }
begin
// , TRIANGLE
end;
//
procedure Forest (N:integer); // N -
const h0=30;
//
var i: integer;
a,b,h: integer;
color1,color2,: color;
begin
For i:=1 to N do
begin
h:=random(h0)+10;
//
a:=random(WindowWidth)+20; // x
b:=random(WindowHeight)+5; // y
color1:=ClRandom;
//
46

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

color2:=ClRandom;
//
fir(a,b,h,color1,color2); //
end
end;
begin
{ }
Forest(25);
end.
, ,
- .
6.
, , , Fir. 3
(. ).
. .
, , . , ,
(, h+5 h+7 ). . , , ,
.
, Fir 3 .
83
, (
),
.
Proc4.pas.
, , .
,
polygon.
84
.pas. .
, .

triangle. .
85
,
( ) (
).
.
.

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)



! , 70 %
30 % .
.
(, ), ,
PascalABC.NET.
.
, ( ) , , ,
. , , , .

48

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

13

86
(Examles\\index.html) . , .
.
1. : (WHILE)
,
.
WHILE , , .
.
:
WHILE <> DO <>

, <> TRUE ().


87
:
) lab13_86.pas;
) ;
) (
M 1000, 200, 0, -5). ,
;
) , ,
N . ,
N. 2025, N=9.
1.3. (REPEAT)
,
, . .
:
REPEAT
< 1>;
< 2>;
...
< N>
UNTIL <>

, <> FALSE ().

, ,
, !

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

88
:
) lab13_87.pas;
) ;
) ;
) , =999.
89
:
) lab13_88.pas;
) ;
) ;
) , .
90
, :
1 1 1 1
(1) n1
...) ( 3,141 592);
) 4(1 ...
3 5 7 9
2n 1

) e 1

1 1 1 1
1
... ... ; ( e 2,718 281).
1! 2! 3! 4!
n!

,
.

1.
. 0,
.
.
2. ,
.
3. ,
.
4. ,
.
5. .
6. - . ,
,
(, 1 999),
. ,
,
, , !,
50

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

.
.
7. . .
8.
. :
1 , 2- - 2, 3- - 4,
4- - 8 .. ,
, N .
9. ,
, .
,
, .


. PascalABC.NET. . , .

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

14.

91
(Examles\\index.html) . , .
.
92
(
lab14_90.pas) f(x) = 2x + 30. ,
( ,
, Ox Oy
(-15,0) (0,30) ).
93
, :
) f(x) = 2x + 30;
) f(x) = x - 80 - 40 - 20 - 10
( abs).
94

f(x)= 0.01x2 + 3x 7. ? , ,
. :
, f(x)
. x y
Real. . ,
, ,
PutPixel .
Round .
: a:=Round(b) , a Integer, b Real.
.
95

f(x) = Sin(x).
? , ? - . ,
Sin(x) -1 +1,
Ox, .
, ,
. .
, 50,
2, 100 ,
. ,
52

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, x
, (
50), y.
,
lab14_93.pas.
96

( lab14_94.pas),
r(a) = a. , (
).
, :
) ;
) ;
) ;
) , r(a)=sin(n*a) ,
n . (
, ,
.)
97
:
) ;
) .
98
, , ,
.

1. , :
: r=2 sin 2 ;
: r=tg sin ;
2
: r ;

1 sin
1 sin
; (r
);
cos
cos

: r

: r2=cos 2;
: r=a (1+ b cos );

r
.

2. , :

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

:
:

x=a(t-sin t); y=a(1-cos t);


x=a cos3 t; y=a sin3 t;

3t
3t 2
x
, y
.
1 t3
1 t3

3. , :

x3 1
y
;
4x2
y = (x2 - x - 6)2;
|x|+|y|=1;

||x| +|y| -

3
1
|= .
2
2

. .
. PascalABC.NET. ,
.

54

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

15.
.
, , .
99
PascalABC.NET. ( ),
GraphABC GraphABC:
.

Cirle, FillCircle, DrawCircle, Ellipse,


FilleEllipse, DrawEllipse,
DrawRoundRect.

Arc,

Pie,

Chord,

RoundRect,

FillRoundRect,

100
, :
) ;
) ;
) ;
) n .
101
, :

,
3 , , .
102
SetPixel.pas. , ,
.
, . ,
.
103
PascalABC.NET (,

).
(
GraphABC GraphABC: ).

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

104
, 5 .
. ,
, .
105
:
) ;
) ;
) .
106
( )
PascalABC.NET (

).

( GraphABC GraphABC:
, GraphABC: Brush GraphABC:
).
107
, 5 ,
.

1. , :
) ;
) .
2. ,
.
3. - ,
1/12
( ).
.
4. ,
.
5. ,
.
6. ,
.
7. ,
.
.

56

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

8.
, .
. , t
,
, \oswt\, w -
.
9. ,
,
.
10. .
: .
.
11. ,
.
, ,
.
,
.
.
12. .
, .
.
13. , :

. .
. PascalABC.NET. ,
.

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

16.

108
(Examles\\index.html)
- . , .
GraphABC ,
bmp, jpg gif.
.
109
pic_01.pas. , ,
. , :
) ;
) .
.
110
, .
, : , .
.
!

DigitalClock.pas
( ).
.

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

. .
. PascalABC.NET.

,
.
58

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

17.

, : , . . : ,
, - , - ,
.
.
, , ?
: - . , .
112
, GraphABC: (
, GraphABC).
.
PascalABC.NET
, .
, (
CloseWindow).
113
:
) event_01.pas;
) ;
) , ;
) , :
;
;
;
10- ;

(100, 100) (300, 300).
114
, :
(, ,
) ( );
;

59

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


, ;

.
115
, ,
event_01.pas,
().
s.
116
, -
,
.

1. ,
, 2
(, ) .
Paint.
2. (.. ,
- .
,
, ).
3. . :
, .
(,
:
).
4. . : (,
, , . ).
( ,
..). , , , .
()
. , ,
( ). ,
. , , , 10
.
. . , .

60

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

18.

117
(Examles\\index.html)
. , .
.
1.
118
string_01.pas.

. , ,
, , .
, :
) ;
) .
119
string_02.pas.
.
,
. ,
. .
120
string_03.pas
. , .
,
( ).
121
string_04.pas
. , .
,
. ?

.
122
.
,
(, , , , ,
). , .
,
.
61

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

2.
123
,
, :
) ;
) ;
) (, ",", ".",
"!", "?", ";", "-");
) .
124
string_05.pas ,
, . ,
. , , :
) ;
) , (, 123);
) (, 12.34);
) , , 375 375a.
, i (, ,
Real Integer)?
, ,
, .

,
.
125
,

1 <> 2 <> 3 ... <> N,
1...aN , <> (+)
(-) .
126
string_06.pas
, .
,
. ?
127
string_06.pas ,
:
) , ;
) , ;
62

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

) ;
) .
128
, , 1
999.

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

.
10. ,
( 36 ).
11. , ,
, ..
( , ). :
; .

. . .
PascalABC.NET.

,
.
63

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

19.

129
(Examles\\index.html) . , .
.
.
130
1. PascalABC.NET.
2. Proc5.pas.
3. . ,

.
4. . :
) ?
) ?
) , ?
) . ?
5. . ?
, .
?
, .
6. . ,
.
7. , .
8. .
131
Proc6.pas. ,
.
, , :
) ;
) ;
) ;
) ;
) ;
) .
(, , ,
, ..).

.
132
1. Proc7.pas.
64

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

2. TOWN .
.
HOUSE, .
, .
3. . , ,
?
4. .
5. ( ) ,
, .
.
133
1.
(, , , ).
TOWN.
2.
, . :
,
. !
134
-
. ,
, ..
. . ,
, , ,
. ,
( ) ,
.

. .

1. ,
.
, ,
.
.
2. ,
.
3. , ,
.
65

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

4. , , (25.06),
( ).
5. , (15
2011 ) (15.05.2011).
6. , ,
, (,
).
7. , (, ).
8. ,
.
9. ,
.
10.
,

. ,
(.. ,
, () ,
).
11. ,
.
12. ,
.
13. LineRel(xs,ys), ,
, (xs, ys)
(.. (x+xs, y+ys)).

. .
PascalABC.NET.

,
.

66

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

20.
:
135
(Examles\\index.html) .
, .
.
136
PascalABC.NET.
, :
) ( 50);
) ;
) , -
;
) , ,
"@" , - "#".
) , 1-, 4-, 7- .. , 0, 3,
.
137
array_1.pas.
15
. , . , ( END.)
138
array_1.pas , , .
139
. , .
140
.
, .
141
. ,
67

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

. ,
, .
142

. ,
.
143
.
, , .
144
,
( , , ,
..). ,
, .. .
,
, .. .
array_2.pas.
. , , ,
, . , , .
, , (Real)
, (String[...]) .
145
array_char_01.pas. ,
, . ,
() , .
146
.
, ( )
.


. UpCase
LowerCase. (
, ,
).


1. ,
. .
68

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

2. . ,
,
.
3. .
. ,
, . ,
, :
.
4. , .
5. , .
,
.
6. .
,
. ,
.
7. .
.
, .
8. .
.
9. ( ..).
, 100 ..
10. ,
.
. :
) . , ;
) "vvv". ,
;
) . :
- 100%;
) . :
50% ; 50% ;
) 123 123.
, ,,..., 10%.
11.
, .

, ..
:

( a1 M ) 2 ... ( a n M ) 2
D
,
n
ai - , M
.
69

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

(
!).
12.
() (. 4).
""
700

( ..)

700
570

560

600

500

450

500
400
300
200
100
0
1993

1994

1995

1996

1997

. 4. ()

,
. 2 : 2-
(. 4) 3- (. 5).

,
(, 1 100)
.
,
, , ,
( ).
.
700
600
.)

500

560

570
450

500

400
300
200
100
0
2006 2007
2008 2009
2010

. 5.

13.
,

,
(. 6).
70

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

"" (. .)

. 6.

, 3, 5 2. : 3+5+2=10. , 3 30% , 5 50% 2 20%. 30% 3600,3=108, 50% 180 20% 72.
3 , 108, 180 72. ,
.
.
14. , .
:
1) ;
2) , ,
,
.
, , 1 10%;
3) .
15. ,
,
18 , 18 50 50 .

-, , .

. .
,
.

71

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

21.

147
(Examles\\index.html) . , .
148
,
, . ,
.
149

.
,
.
150
, .
151
:
.

152
,
, , .
,
, ,
, . ,
.
: ,
, .
.
. , .
153
.
:
1) ;
2)
( ) .

72

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


1. . ,
,
, , .
2. , . ,

.
3. , .
, .
, .. :
(
),
.
.
4. .
. .
, ,
.
5. ,
. a1, a2, , an.
.
. a1, a2, , ai , . . a1
a2 ai. ai+1
, .
, i+1 n .
6. ,
. n .
. :
ai ai+1. ai ai+1,
. ai>ai+1,
. .
7.
. . , .

73

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

22.

154
(Examles\\index.html) . , . .
155


. , ,
. ,
.
156

, .
157
,
.
158
, 5 .
:
) ;
) , ;
) , ;
) ,
;
) , ;
) , ;
) , ;
) , .
159
,
:

57.9
108.2
149.6
227.9
978.3
1429.3

0.06
0.92
1.00
0.15
1345.00
767.00

0.05
0.81
1.00
0.11
318.40
95.20
74

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)

, :
) ,
;
)
, .
;
) .
.
. .
,
.

75

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


1. . . ., 1991.
2. . . ., 1988.
3. . .
. -: /
New publishing house, 2004 .
4. . . ., 1982.
5. ., . . :
, 1991.
6. . : . : - - 2001.
7. . : . : - - 2000.
8. . . . :
. .: -, 2007.
9. . . . :
. .: , 2007.
10. .., ..
( 5.5): .-. . ., 1992.
11. Borland Pascal with Objects 7.0.
, 1993.
12. .. . . .:
, 2005.
13. .. Turbo Pascal. Delphi. .:
-, 2006. 416 .
14.
petrsu.karelia.ru/psu/Chairs/IMO/pascal/

15. PascalABC.NET: sunschool.math.rsu.ru/pabc/

76

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)


PascalABC.NET

:
- ..

25.06.11. 70x108/16. . .
. . . 17,7. .-. . 18,0. . ______ .
______

-. , . .

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com)