C用个冒泡就可以了
N=strlen(str);
for (i=0;i
{
t=str[j];
str[j]=str[j+1];
str[j+1]=t;
}
VB代码如下
for i=1 to len(mystring)
pp(i)=mid(mystring,i,1)
next i
for i = 1 to len(mystring)-1
for ii= i+1 to len(mystring)
if pp(i)>pp(ii) then
temptstring=pp(i)
pp(i)=pp(ii)
pp(ii)=temptstring
end if
next ii
next i
temptstring=""
for i=1 to len(mystring)
temptstring=temptstring+pp(i)
next i
'现在temptstring变量里面存的就是你想要的了在不在数组pp()里面也是
变量未定义自己看着点儿哈!!