Last active
May 31, 2018 10:21
-
-
Save 0x2f0713/7a27bb7c4edff17e354abe36d01a8359 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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