Skip to content

Instantly share code, notes, and snippets.

@0x2f0713
Last active May 31, 2018 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x2f0713/7a27bb7c4edff17e354abe36d01a8359 to your computer and use it in GitHub Desktop.
Save 0x2f0713/7a27bb7c4edff17e354abe36d01a8359 to your computer and use it in GitHub Desktop.
function filterZeroCharacter(chuoi:string):string;
begin
while (pos('0',chuoi) <> 0 ) do
begin
delete(chuoi,pos('0',chuoi),1);
end;
filterZeroCharacter:=chuoi;
end;
function sortString(chuoi:string):string;
var
i,j: integer;
temp:char;
begin
for i:=1 to length(chuoi) do
for j:=i+1 to length(chuoi) do
if chuoi[i]>chuoi[j] then
begin
temp:=chuoi[i];
chuoi[i]:=chuoi[j];
chuoi[j]:=temp;
end;
sortString:=chuoi;
end;
begin
writeln(filterZeroCharacter(sortString('982918907878')))
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment