77

Click here to load reader

Pasсal ABC 2011 Лаб Работы 1 22 Для Студентов

  • Upload
    evpeny

  • View
    150

  • Download
    43

Embed Size (px)

DESCRIPTION

Russian guide for students in PascalABC

Citation preview

  • -

    ..

    PPaassccaallAABBCC..NNEETT

    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)

  • 3

    ................................................................................................................................................................. 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. .....! .

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

  • 4

    31. ....................................... ! .

    32. ......................... ! .

    33*. ....... ! .

    34. , ... ! .

    35. . .................... ! .

    ................................................................................................. 76

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

  • 5

    -

    . , ( ). , - , - . . - , , , . , 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 (, , . . . . , ). :

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

  • 6

    1) - ( Borland Pascal) DOS-, .. MS DOS, Windows , , -, - ;

    2) PascalABC.NET, , - Delphi, -;

    3) PascalABC.NET Delphi; 4) PascalABC.NET

    ; 5) ,

    . :

    ; ; (-

    ) . -, ;

    0 . , . - , ;

    * , -, - ;

    ** , - , -.

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

  • 7

    1.

    PascalABC.NET

    1. PascalABC.NET

    .

    1 . , . Pascal, . . \Examples .

    1.1.

    2 PascalABC.NET ( PascaABC.NET PascalABC.NET). , (. 1).

    (

    )

    ( )

    . 1. PascalABC.NET

    3 , . 1.

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

  • 8

    , . ,

    , ( . 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. . , . .

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

  • 9

    ( ), .

    ().

    . 2. ,

    , . 8

    olors.pas. , . , .

    1.2.3.

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

    9 . , - .

    1.2.4.

    . - . , Program1.PAS. , -

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

  • 10

    (.. ), 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 . .

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

  • 11

    , () .

    13 (Examples\ \index.html). "". . .

    2.

    1. PascalABC.NET? 2. ? ? 3. ?

    ? 4. . -

    ? 5. , - ? 6. ? 7. ()

    ?

    , . . PascalABC.NET.

    - , - ( ).

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

  • 12

    2.

    1.

    :

    program ; ; Begin ;

    ; () ; ; ...

    end. . :

    1) () ; 2) END ; 3) BEGIN ; 4) END .

    2.

    2.1.

    , , - . : , .

    , , . - VAR: var num : integer; num,

    ( -2147483648 2147483647.). integer () ( ) , - . , num integer (- ). -. - . - , -, .

    - / , . : _

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

  • 13

    .

    ! , , !

    , , - ( : , - ):

    Program, begin, end, var, integer.

    ! VAR () . !

    (.. ) :

    integer - -2147483648 2147483647; byte - 0 255; word - 0 65535; real - ; char - Unicode ( 2 ); string - .

    2.2. ,

    : , . : (1) ,

    . : 345 , -12222 ; (2) :

    : -123.234, 92929.3456 ( , , ), ( : ). , 1,231012 :

    1.23+12 +12 ; (3) ,

    : . ... 2+2=5

    . :

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

  • 14

    : (:=), !

    1.

    program example1; { } var num : integer; {

    } day : byte; {

    0 255} name : string; { } begin

    num355; { num 355} day31; { day 31 } name { name }

    end. , -

    . () .

    2. program example2;

    var num : integer;

    day : byte; Begin

    num355+145; { num 500} daynum -469; { num

    (500) - (31)}

    end.

    -: , . , - , , .

    2.3.

    , , -, . . . , 1 WriteLn.

    1 ,

    . , PascalABC.Net .

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

  • 15

    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 .

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

  • 16

    23 , , , , , -. . writeFormat.pas .

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

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

  • 17

    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. , . - , ,

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

  • 18

    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. .

    , - ( ).

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

  • 19

    4.

    ( )

    , () PascalABC.NET - . , . -, ( - ), GraphABC. . - (.. ). . , , .

    1. GraphABC

    (.. - ) ( ), . , -, GraphABC , .

    Uses. GraphABC, . 2:

    Program ; Uses GraphABC;

    ...

    , , .

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

    2 ,

    .

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

  • 20

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

    0,0

    y . 3.

    . ,

    Y , (. 3)!

    31 lab4_31.pas. . - . , : ) ; ) ; ) : ,

    .

    32 lab4_32.pas. , ( ). , . :

    ) ; ) .

    , ( WriteLn) , . WriteLn.

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

  • 21

    33 lab4_33.pas , . . , , . : , , : ) ; ) .

    34 : ) 300200 ( : , ,

    - ); ) 300200 ; ( : , ,

    - ); ) 300200 (

    ).

    35 : ) ; ) ; ) , , .

    36* , , - . , , ..

    GraphABC ( GraphABC).

    3.

    , : 1) (). -

    ; 2) .

    TextOut. , 26 , -;

    3) . , , -, 5 , ; ;

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

  • 22

    4) , :

    5) ,

    250250 :

    6) 5 , , 150150 :

    7) , . 5 , , , , . 250150 .

    8) . 200200 , clGold, - MoveTo LineTo.

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

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

  • 23

    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 ; ) ; ) ,

    (, :

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

    1. , : ) , .

    30 ; ) ;

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

  • 24

    ) -;

    ) . 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 - .

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

  • 25

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

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

  • 26

    6.

    40 (Examles\\index.html) , . . .

    1.

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

    - ( , IF).

    2. IF

    41 PascalABC.NET. , , , . .

    42 PascalABC.NET. lab6_41.pas. . . ? , : ! .

    43 . : 7. , .

    44 1. ,

    .

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

  • 27

    2. ( ). ? .

    3. . 4. lab6_43.pas.

    , , . . , . ( , , .)

    45 1. lab6_44.pas. 2. .

    . 3. , ,

    (, , ), .

    1 , ( , , . : , , ).

    2 , : ) ; ) ? .

    3 , ( +=0). : , , ( ).

    1. , , - (x,y) R .

    2. , , () (x,y). . , .

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

  • 28

    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. . , (- ).

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

  • 29

    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).

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

  • 30

    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.

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

  • 31

    (, ..). , .

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

    5. 10 40, - . , - , : 18 , 21 .

    6. 100 999. , , : 145 , 768 .

    - . PascalABC.NET. . , - .

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

  • 32

    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 . , :

    ) ; ) .

    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)

  • 34

    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 Gra-phABC: .

    SetPenStyle(ps: integer); , ps.

    (ps) . - . (): GraphABC GraphABC: .

    SetPenWidth(w: integer); , w .

    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)

  • 36

    4. ( ) .

    5. . 6. -

    : )

    )

    )

    )

    )

    )

    )

    )

    . PascalABC.NET. . , -.

    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)

  • 38

    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. .

    - , .

    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)

  • 40

    ) lab11_70.pas: : real. , .

    2.3.

    72 N N :

    12 = 1 22 = 1 + 3 32 = 1 + 3 + 5 42 = 1 + 3 + 5 + 7 .

    , .

    73 . , . , :

    ) e = 1+ ...!

    1...

    !41

    !31

    !21

    !11

    n

    ; ( e = 2,718 281);

    ) ...)12

    )1(...

    91

    71

    51

    31

    1(41

    n

    n

    ( = 3,141 592);

    ) 2 =2

    12

    )1(1...

    71

    151

    131

    1k

    k

    ( 2 1,414 213)

    2.4.

    74 . , , , .

    75 , . .

    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)

  • 42

    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. .

    - , .

    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)

  • 44

    , 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 , .

    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)

  • 46

    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; //

    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)

  • 48

    ! , - 70 % 30 % .

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

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

    .

    .

    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

    ; ; ...

    UNTIL , FALSE ().

    , , , !

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

  • 50

    88 : ) lab13_87.pas; ) ; ) ; ) , =999.

    89 : ) lab13_88.pas; ) ; ) ; ) , .

    90 , :

    ) ...)12

    )1(...

    91

    71

    51

    31

    1(41

    n

    n

    ( 3,141 592);

    ) ...!

    1...

    !41

    !31

    !21

    !11

    1 n

    e ; ( e 2,718 281).

    , .

    1. . 0, . .

    2. , .

    3. , .

    4. , .

    5. . 6. - . ,

    , (, 1 999), . , , , , !,

    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)

  • 52

    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 , . ,

    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 ;

    :

    cossin1

    r ; (

    cossin1

    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)

  • 54

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

    : 3

    2

    3 13

    ,1

    3t

    ty

    tt

    x

    .

    3. , :

    23

    41

    xx

    y

    ;

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

    ||x| +|y| - 23 |=

    21 .

    . - . . - PascalABC.NET. - , .

    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, Arc, Pie, Chord, RoundRect, FillRoundRect, DrawRoundRect.

    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)

  • 56

    104 , 5 . . , , .

    105 : ) ; ) ; ) .

    106 ( ) PascalABC.NET ( ). ( GraphABC GraphABC: , GraphABC: Brush GraphABC: ).

    107 , 5 , .

    1. , : ) ; ) .

    2. , .

    3. - , 1/12 ( ). .

    4. , .

    5. , .

    6. , .

    7. , . .

    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)

  • 58

    16.

    108 (Examles\\index.html) - . , - .

    GraphABC , bmp, jpg gif. .

    109 pic_01.pas. , , . , : ) ; ) . .

    110 , . , : , . . ! DigitalClock.pas ( ). .

    , , , . : , .

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

    . - . . - PascalABC.NET.

    - , .

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

  • 59

    17.

    , - : , -. -. : , , - , - - , . .

    , , ? : - - . , .

    112 , GraphABC: ( , GraphABC). . PascalABC.NET , . , ( CloseWindow).

    113 : ) event_01.pas; ) ; ) , ; ) , :

    ; ; ; 10- ;

    (100, 100) (300, 300).

    114 , :

    (, , ) ( );

    ;

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

  • 60

    , ;

    .

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

    116 , - , .

    1. , , 2 (, ) . Paint.

    2. (.. , - . , , ).

    3. . : , . (,

    :

    ). 4. . : (,

    , , . ). ( , ..). , , , . () . , , ( ). , . , , , 10 .

    -. . - , - .

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

  • 61

    18.

    117 (Examles\\index.html) . , . .

    1.

    118 string_01.pas. . , , , , . , : ) ; ) .

    119 string_02.pas. . , . , . .

    120 string_03.pas . , . , ( ).

    121 string_04.pas . , . , . ? .

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

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

  • 62

    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 , : ) , ; ) , ;

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

  • 63

    ) ; ) .

    128 , , 1 999.

    1. , . .

    2. , . , .

    3. , . , , . .

    4. , . .

    5. , ?. , .

    6. , . , .

    7. . .

    8. . 9. , .

    .

    10. , ( 36 ).

    11. , , , .. ( , ). : ; .

    . - . - . PascalABC.NET.

    - , .

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

  • 64

    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.

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

  • 65

    2. TOWN . . HOUSE, . , .

    3. . , , ?

    4. . 5. ( ) ,

    , . .

    133 1.

    (, , , ). TOWN.

    2. , . : , . !

    134 - . , , .. - . - . , , , , . , ( ) , . . .

    1. , . , , . .

    2. , .

    3. , , .

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

  • 66

    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.

    - , .

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

  • 67

    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 - . ,

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

  • 68

    . , , .

    142 . , .

    143 . , , .

    144 , ( , , , ..). , , .. . , , .. . array_2.pas. . , , , , - . , - , . , , (Real) , (String[...]) .

    145 array_char_01.pas. , , . , () , .

    146 . , ( ) .

    . UpCase LowerCase. ( , , ).

    1. , . .

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

  • 69

    2. . , , .

    3. . . , , . , , : .

    4. , . 5. , .

    , .

    6. . , . , .

    7. . . , .

    8. . .

    9. ( ..). , 100 ..

    10. , . . : ) . , ; ) "vvv". ,

    ; ) . :

    - 100%; ) . :

    50% ; 50% ; ) 123 123.

    , ,,..., 10%. 11.

    , . , .. :

    nMaMa

    D n22

    1 )(...)( ,

    ai - , M .

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

  • 70

    ( !).

    12. () (. 4).

    ""

    700

    560

    450500

    570

    0

    100

    200

    300

    400

    500

    600

    700

    1993 1994 1995 1996 1997

    (

    .

    .)

    . 4. ()

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

    0

    100

    200

    300

    400

    500

    600

    700

    2006 2007 2008 2009 2010

    560

    450500

    570

    (. .)

    . 5.

    13. , , (. 6).

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

  • 71

    "" (. .)

    . 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 . -, -, .

    -. .

    - , .

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

  • 72

    21.

    147 (Examles\\index.html) - . , .

    148 , , . , .

    149 . , .

    150 , .

    151 : .

    152 , , , . , , , , . , . : , , . . . , .

    153 . : 1) ; 2)

    ( ) .

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

  • 73

    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. -

    . . - -, -.

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

  • 74

    22.

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

    155 . , , . , .

    156 , .

    157 , .

    158 , 5 . : ) ; ) , ; ) , ; ) ,

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

    159 , :

    .

    .

    57.9 0.06 0.05 108.2 0.92 0.81 149.6 1.00 1.00 227.9 0.15 0.11 978.3 1345.00 318.40 1429.3 767.00 95.20

    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)

  • 76

    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/

    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)