All pastes #61063 Raw Edit

Ikaravas

public text v1 · immutable
#61063 ·published 2006-06-02 16:08 UTC
rendered paste body
Program CleanSpaces;

VAR
c : char;
Infile : text;


Begin
  Assign(Infile,'text.txt');
  Reset(Infile);

Repeat
 Repeat

  Read(Infile,c);
   If c IN ['!','?','.'] Then
      Begin
        Write(c);
        Read(infile,c);
        If c = ' ' Then
           Begin
             Write(c);
             Read(infile,c);
             If C= ' ' then
                Begin
                  Read(infile,c);
                  Write(c);
                End;
           End;
        End
   Else
  Write(c);
 
 Until(Eoln(Infile));
 
  readln(infile);
  writeln;

Until(eof(infile));

Close(infile);

End.