<span>PROGRAM</span> Probel;
<span>var</span> s<span>:</span><span>string</span>; n<span>,</span>i<span>:</span><span>integer</span>;
<span>begin</span>
<span>writeln</span><span>(</span><span>'введите текст с пробелами '</span><span>)</span>;
<span>readln</span><span>(</span>s<span>)</span>; repeat inc(i);
n<span>:=</span>length<span>(</span>s<span>)</span>;
<span>if</span><span>(</span>s<span>[</span>i<span>]</span><span>=</span><span>' '</span><span>)</span><span>and</span><span>(</span><span>(</span>s<span>[</span>i<span>+</span><span>1</span><span>]</span><span>=</span><span>' '</span><span>)</span><span>)</span><span>then</span>
<span>begin</span>
delete <span>(</span>s<span>,</span>i<span>,</span><span>1</span><span>)</span>;dec<span>(</span>i<span>)</span>;
<span>end</span>;
<span>until</span> i<span>=</span>n;
<span>writeln</span><span>(</span><span>'удалены лишние пробелы '</span><span>)</span>;
writeln(s);
<span>end. </span>