UNIX Free Pascal


.


13.24. , .

var

fb,copyfb:file of byte;

size,n:longint;

b:byte;

{$I-}

begin

if paramcount<>2 then

begin

writeln(': ',paramstr(0),' _ ');

exit;

end;

assign(fb,paramstr(1));

assign(copyfb,paramstr(2));

reset(fb);

if ioresult<>0 then

begin

writeln(' : ',paramstr(1),' ');

exit;

end;

rewrite(copyfb);

if ioresult<>0 then

begin

writeln(' : ',paramstr(2),' ');

exit;

end;

n:=filesize(fb);

while n>=0 do

begin

//n:=n-2;

seek(fb,n-1);

//blockread(fb,b,1);

//blockwrite(copyfb,b,1);

read(fb,b);

write(copyfb,b);

n:=n-1;

end;

close(fb);

close(copyfb);

end.

 

13.25. ( ).

{I-}

var

fin,fout:file of byte;

pass:string;

size:longint;

b:byte;

begin

if paramcount<>2 then

begin

writeln(': ',paramstr(0),' _ ');

exit;

end;

assign(fin,paramstr(1));

assign(fout,paramstr(2));

reset(fin);

if ioresult<>0 then

begin

writeln(' : ',paramstr(1),' ');

exit;

end;

 

rewrite(fout);

if ioresult<>0 then

begin

writeln(' : ',paramstr(2),' ');

exit;

end;

 

writeln(' : ');

readln(pass);

size:=0;

while not(eof(fin)) do

begin

read(fin,b);

b:=b xor byte(pass[1 + (size mod length(pass))]);

write(fout,b);

inc(size);

end;

close(fin);

close(fout);

end.

 

13.26. cmp.

type

mas=array [1..1] of byte;

 

var

fb,fbx:file of byte;

size,n,nx,i:longint;

t:boolean;




- -  - -  - -