. .

1. f.dat . g.dat f.dat .

f.dat.

program lab10_1;

uses CRT;

var f: File of integer;

i, n, x: Integer;

begin clrscr;

assign {f, 'F.dat');

rewrite (f);

writeln ( ' ');

readln (n);

for i: = 1 to ndo

begin

writeln ( ' ', i, '- ');

readln (x);

write (f, x)

end;

close (f)

end.

f.dat, , , g.dat. g.dat .

program lab10_11;

uses CRT;

var f, g: File of integer;

i, x: Integer;

begin clrscr;

assign {f, 'F.dat');

reset (f);

assign {g, 'G.dat');

rewrite (g);

while not eof (f) do

begin

read (f, x);

if x<0 then write (g, x)

end;

{ g.dat }

reset (g);

while not eof (g) do

begin

read (g, x);

writeln (x)

end;

close (f);

close (g)

end.

2. f.dat . -1. .

program lab10_2;

uses RT;

var f: File of integer;

i, x: Integer;

begin clrscr;

assign (f, 'F.dat');

reset (f);

while not eof (f) do

begin

read (f, x);

if x<0 then

begin

x: = -1;

seek (f, Filepos (f) -1);

write (f, x)

end

end;

{ f.dat }

reset (f);

while not eof (f) do

begin

read (f, x);

writeln (x)

end;

close (f)

end.

3. ' FV , 8 . , GM .

program file12;

type vect = array [1..8] of real;

fil1 = file of vect;

fil2 = file of real;

var a: Vect;

i: Integer;

max, b: Real;

f1: Fil1;

f2: Fil2;

begin clrscr;

assign ( f1, 'FV.DAT');

assign ( f2, 'GM.DAT');

reset ( f1);

rewrite ( f2);

while not eof ( f1) do

begin

read ( f1, a); amax: = a[1];

for i: = 1 to 8 do

if a[i]> amaxthen amax: = a[i];

write ( f2, amax);

end;

close ( f2);

reset ( f2);

while not eof ( f2) do

begin read ( f2, B);

writeln ( b: 7: 2)

end;

close (f1);

close (f2);

end.


̲

1. .
2. .
3. . .
4. . .
5. .
6. .
7. .
8. .
9. .
10. ()
11. .

. .

. . 02558 18.08.2000

ϳ 2010 60 * 84 1/16

. . . .-. .

350 .

- ʳ

192102. -, . , 22

ϳ ʳ

192102. -, . , 22

. .

100103 - -




| 1. | | 3. | 4. | ̲ ò ˲ | Ҳ òͲ | | 8. | 9. |

© um.co.ua -