211
>Din fisierul in.txt, de pe fiecare linie sunt sterse toate caractere cu exceptia
primului si ultimului.
program c_119_1;
var f,g:text;
ch:char;
ok:boolean;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
while not eof(f) do begin
read(f,ch);write(g,ch);write(ch);
ok:=true;
while not eoln(f) do begin
read(f,ch);
ok:=false;
end;
if not ok then begin
write(g,ch);writeln(ch);
end;
readln(f);
writeln(g);
end;
close(f);
close(g);
{erase(f);rename(g,'text.in');}
readln;
end.
{ by Ioana PascalZone.evonet.ro }
0 comentarii