Acasa Tehnologie Stergere caractere

Stergere caractere

by Dragos Schiopu

>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 }

s-ar putea sa-ti placa

0 comentarii

Codruta 18-05-2010 - 19:18
Codruta 18-05-2010 - 19:20