var s,ans:string; i:longint; b:array[0..255] of boolean; begin readln(s); fillchar(b,sizeof(b),true); ans:=''; for i:=1 to length(s) do if b[ord(s[i])] then begin b[ord(s[i])]:=false; ans:=ans+s[i]; end; writeln(ans); end.
这个可能要开ansistring吧, 过长的话还可以用eoln。 var c:array[0..255] of boolean; ch:char; begin while not(eoln(input)) do begin read(ch); if c[ord(ch)]=false then begin c[ord(ch)]:=true; write(ch); end; end; end.