Mohti
95Messages postés
31 juillet 2008Date d'inscription
20 septembre 2011Dernière intervention
14 oct. 2009 à 17:54
j'essaye deja d'integrer sa a mon programme. : sa sert a supprimer les espace inutiles. :
Program supespacesuperflu;
Function let(s:string; i:word):boolean;
Var prec:boolean; (*prec=true si c'est un espace qui précède*)
Begin
If (i=1) then prec:=true;
If (s[i]<>' ') then begin prec:=false; let:=true; end else
If (s[i]=' ') then
Begin
If (prec=true) then
begin let:=false; prec:=true; end
else
begin let:=true; prec:=true; end;
End;
End;
Var s,d :string;
i:word;
Begin
d:='';
i:=1;
WriteLn('Entrez votre phrase : ');
ReadLn(s);
While (i<=length(s)) do
Begin
If (let(s,i)=true) then d:=d+s[i];
i:=i+1;
End;
WriteLn(d);
ReadLn;
End.
Mais pour le reste je ne sais pas comment faire .