.


:




:

































 

 

 

 





Assign (Var f; FileName: String) , f , MSDOS, FileName. , f FileName. FileName ( ), MSDOS (CON, PRN . .) .

 

Assign (f, file.dat); { }

Assign (f, a: \ X.dat); { :}

Assign (f, LPT1); { }

Assign (f, ); { , , CON}

 

. * ? , ( ).

, , .

1.3.

. . , . , . : , . , , .

. .

, , , .. .

 

Type f: File Of <>.

 

, . , (, .), .

:

 

Type

Dim = Array [1..100, 1..2] of Real;

Zap = Record

x, y: Byte;

a: Dim;

End;

Df = File Of Dim;

Zf = File Of Zap;

 

:

 

Type

ff1 = File Of File Of Real;

ff2 = File Of Df;

FZapF = Record

x, y: Byte;

f: File Of Char

End;

Zap = File Of FZapF;

 

. :

 

Var Fr: File Of Real; Fd: File Of Zap;

 

, .

, , . . , , . :

Reset (f);

f , Assign . . , , , .. 0;

Rewrite (f);

, f. Rewrite . .

Close (f) . . Close .

Read (f, <. >);

<. > , , ( , File Of < >). 0. . , .

Write (f, <. >);

Read. , , , . . Readln Writeln. , .

Eof (f) Boolean: True, , False . f .

. . . . f V . , :

 

Reset (f); For i:= 1 to 5 do Read (f, V); Writeln(V);

 

V , , . . .

Seek (f, <N >) f. . .

FilePos (f) . Longint.

Filesize (f) . Longint.

Truncate (f) f .

1. . .

 

Program Task1;

Uses CRT;

Var ct: File Of Integer;

{ . Integer}

i, n, m: Integer;

Begin

Clrscr;

Assign (ct, a:\int.dat);

{ :}

Rewrite(ct); { }

Writeln( ?);

Readln(n); { }

Write(ct, n); { }

For i:= 1 To n Do { }

Begin

Readln(m); { }

Write(ct, m); { }

End;

Repeat Until keypressed; { ,

- }

Close (ct); { }

End.

 

2. , .

 

Program Task2;

Uses CRT;

Var ct: File Of Integer;

i, n, m: Integer;

Begin

Clrscr;

Assign (ct, a:\int.dat);

Reset(ct);

Read(ct, n);

{ }

Writeln( = ,n);

For i:= 1 To n Do

Begin

Read(ct, m); { }

Writeln(i, - , m); { }

End;

Repeat Until keypressed;

Close (ct);

End.





:


: 2016-11-18; !; : 2112 |


:

:

,
==> ...

1688 - | 1678 -


© 2015-2024 lektsii.org - -

: 0.02 .