All pastes #61193 Raw Edit

Updated Q.A2

public text v1 · immutable
#61193 ·published 2006-06-02 21:13 UTC
rendered paste body
Program QA2;

VAR
C : char;
infile : text;


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

Repeat

 Repeat
   Read(infile,c);
    If c IN ['!','.','?',' '] then
       Begin
         If c <> ' ' then Write(c);
         Repeat
           read(infile,c);
         Until(c <> ' ');
         Write (' ');
         Write (c);
       End
    Else
       Write(c);
 Until(EOLN(Infile));

Readln(infile);
Writeln;

Until(EOF(Infile));


Close(infile);

End.