Код
program ex2;
Uses crt;
var f:text;
s:string;
i,k,l:integer;
BEGIN
ClrSCR;
{assign(f,'c:\TP7\Files\21.pas');
rewrite(f);}
write('Vvedite stroky: ');readln(s);
s:=s+' '; l:=length(s);
k:=0; i:=1;
While i<=l do
begin
If s[i]<>' ' then
begin
while s[i]<>' ' do
begin
i:=i+1;
k:=k+1;
If k=2 then
delete(s,i-1,1)
end;
k:=0;
end;
i:=i+1;
end;
writeln(s);
{while not eof(f) do
writeln(f,s);
close(f);}
readln;
END.
Uses crt;
var f:text;
s:string;
i,k,l:integer;
BEGIN
ClrSCR;
{assign(f,'c:\TP7\Files\21.pas');
rewrite(f);}
write('Vvedite stroky: ');readln(s);
s:=s+' '; l:=length(s);
k:=0; i:=1;
While i<=l do
begin
If s[i]<>' ' then
begin
while s[i]<>' ' do
begin
i:=i+1;
k:=k+1;
If k=2 then
delete(s,i-1,1)
end;
k:=0;
end;
i:=i+1;
end;
writeln(s);
{while not eof(f) do
writeln(f,s);
close(f);}
readln;
END.