UNIX Free Pascal




. - 4


end;

end;

s:=ParamStr(2);

assign(t,s);

rewrite(t);

for i:=1 to k do

writeln(t,a^[i]);

freemem(a,k*256);

close(t);

end.

 

13.7. , .

Program TabsProg;

function Tabs(s:String):String;

begin

While (Pos(#9,s)>0) do

s:=Copy(s,1,Pos(#9,s)-1)+' '+Copy(s,Pos(#9,s)+1,Ord(s[0])-Pos(#9,s));

Tabs:=s;

end;

var

f1,f2:Text;

sin:string;

begin

if ParamCount<2 then

begin

Writeln('Wrong parameters');

Writeln('Format: ./task <inputfile> <outputfile>');

Halt(1);

end;

Assign(f1,Paramstr(1));

Assign(f2,Paramstr(2));

Reset(f1);

Rewrite(f2);

While Not(eof(f1)) do

begin

Readln(f1,sin);

Writeln(f2,Tabs(sin));

end;

Close(f1);

Close(f2);

end.

 

13.8. , .

Program Tabs;

var

f1,f2:Text;

TmpS:string;

n,Code:Integer;

begin

if ParamCount<2 then

begin

Writeln('Wrong parameters');

Writeln('Format: ./task <inputfile> <outputfile> <column>');

Writeln('<column> - number of column');

Halt(1);

end;

Assign(f1,Paramstr(1));

Assign(f2,Paramstr(2));

Reset(f1);

Rewrite(f2);

if ParamCount=3 then val(ParamStr(3),n,Code)

else n:=40;

While Not(eof(f1)) do

begin

Readln(f1,TmpS);

Writeln(f2,Copy(TmpS,1,n));

end;

Close(f1);

Close(f2);

end.

 

13.9. , 60 .

Program Tabs;

var

f1,f2:Text;

TmpS,StrBuf:string;

n,Code:Integer;

const

step=60;

begin

if ParamCount<2 then

begin

Writeln('Wrong parameters');

Writeln('Format: ./task <inputfile> <outputfile>');

Halt(1);

end;

Assign(f1,Paramstr(1));