.


:




:

































 

 

 

 





,

Object Pascal Borland Delphi 7.0

, .

1.

. 2

12: 2

13: 2

12. .. 3

. 3

. 3

.. 4

. 4

. 5

1: () 5

2: () 5

3: . 6

13. .. 7

. 7

. 7

.. 10

. 10

. 10

1: () 10

2: () 11

3: , () 12

4: , .. 12

5: , () 14

6: , .. 14

: . 16

. 16

. 16

. 17

. 18

. 19


12:

:

\2 \ \ \

.

:

1) (. 4);

2) - ;

.

 

13:

:

1) (. 10);

2) - ;

.

 


12.

: .

Object Pascal , . EOF, , .

- READ, WRITE. . .

:

: 2 4 3 1 0.

Var F: file of integer;

X: integer;

...

Reset(f); //

Read(f,x); // x=2

Read(f,x); // x=4

Reset(f); //

For i:=1 to 5 do read(f,x);// 5

// 5 : x=0

...

 

, , - -, EOF.

, . : , ( ), , , , .

Program Project1;

{--- ---}

{$APPTYPE CONSOLE}

Uses SysUtils, EsConsole in EsConsole.pas;

Var F: File of Integer;

i, j: Integer;

Begin

Randomize;

AssignFile (F, file.dat);

Rewrite (F);

for i:= 1 to Random(20) do

Begin

j:= Random(100);

Write (F,j);

end;

CloseFile (F);

end.

 

Program Project1;

{--- ---}

{$APPTYPE CONSOLE}

Uses SysUtils, EsConsole in EsConsole.pas;

Var F: File of Integer;

i, j: Integer;

Begin

AssignFile (F, file.dat);

Reset (F);

{--- ---}

WriteLn ( : );

While not eof(F) do

Begin

read (F, i);

write (i: 3);

end;

Writeln;

CloseFile (F);

end.

1. ?

2. ?

1.

1) File

2) Of

3) < >

4) < >

5) While

6) Repeat

7) for

2. ,

1) Var f: file of real;

2) Var f: array of real;

3) Var f: real file;

4) Var f: real file real;

5) Var f: real file of real element;

3. ,

1) Var st: file of string[1];

2) Var st: file of array[1] of char;

3) Var st: char file of char;

4) Var st: file of char;

 

1: ()

1. , .

2. .

dosja.my1 ( ). :

;

;

, .

1. .

2. .

3. .

 

2: ()

1. , .

2. .

dosja.my2 ( ). :

;

;

, .

1. .

2. .

3. .

3:

1. .

2. .

, .

1. , . my.

2. , , .

3. , . .

 

1 . , . .

2 . . .

3 . . .

4 . . .

5 . . .

6 . . .

7 . . .

8 . . .

9 . . .

10 . . .

11 . . .

12 . . , , .

 

 


13.

: .

, . : , .

TEXTFILE.

: , . EOLN, (TRUE), .

READ READLN. , , . , .

 

WRITE WRITELN.





:


: 2016-12-06; !; : 429 |


:

:

: , .
==> ...

1500 - | 1470 -


© 2015-2024 lektsii.org - -

: 0.032 .