Ikaravas
public text v1 · immutableProgram 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.