Program ch_distincte;
Var ch:string;
(**************************************)
Procedure saisie (var ch:string);
Begin
Repeat writeln('Saisir une chaîne non vide :');
readln(ch);
Until ch<>'';
End;
(************************************)
Function distincte (ch:string):boolean;
var i:integer; test:boolean;
Begin
i:=0;
test:=true;
Repeat i:=i+1;
If pos(ch[i],ch)<>i Then test:=false;
Until (test=false) or (i=length(ch));
distincte:=test;
End;
(**************** P.P ******************)
begin
saisie(ch);
If distincte(ch) then writeln('cette chaîne est distincte')
Else writeln('cette chaîne est non distincte');
End.
UHJvZ3JhbSBjaF9kaXN0aW5jdGU7ClZhciBjaDpzdHJpbmc7CigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKikgClByb2NlZHVyZSBzYWlzaWUgKHZhciBjaDpzdHJpbmcpOwpCZWdpbiAKUmVwZWF0IHdyaXRlbG4oJ1NhaXNpciB1bmUgY2hhw65uZSBub24gdmlkZSA6Jyk7IApyZWFkbG4oY2gpOwpVbnRpbCBjaDw+Jyc7IApFbmQ7IAooKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKSAKRnVuY3Rpb24gZGlzdGluY3RlIChjaDpzdHJpbmcpOmJvb2xlYW47IAp2YXIgaTppbnRlZ2VyOyB0ZXN0OmJvb2xlYW47IApCZWdpbiAKaTo9MDsgCnRlc3Q6PXRydWU7ClJlcGVhdCBpOj1pKzE7IApJZiBwb3MoY2hbaV0sY2gpPD5pIFRoZW4gdGVzdDo9ZmFsc2U7IApVbnRpbCAodGVzdD1mYWxzZSkgb3IgKGk9bGVuZ3RoKGNoKSk7IApkaXN0aW5jdGU6PXRlc3Q7IApFbmQ7IAooKioqKioqKioqKioqKioqKiBQLlAgKioqKioqKioqKioqKioqKioqKSAKYmVnaW4Kc2Fpc2llKGNoKTsKSWYgZGlzdGluY3RlKGNoKSB0aGVuIHdyaXRlbG4oJ2NldHRlIGNoYcOubmUgZXN0IGRpc3RpbmN0ZScpCkVsc2Ugd3JpdGVsbignY2V0dGUgY2hhw65uZSBlc3Qgbm9uIGRpc3RpbmN0ZScpOwpFbmQu