码迷,mamicode.com
首页 > 编程语言 > 详细

数字排序

时间:2014-11-26 15:56:16      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:io   ar   sp   for   on   cti   amp   as   new   

strA="152648937"
WScript.Echo reversestr(strA)
Function reversestr(strT)
    Set regEx=NewRegExp
    regex.Pattern="\d"
    regex.Global=True
    regex.IgnoreCase=True
    For i=0ToLen(strT)-1
        singlestr = Mid(strT,i+1,1)
        str=str & singlestr & ","
        Set exeStr = regex.Execute(singlestr)
        If regex.Test(singlestr)=FalseThen
            WScript.Echo "不是数字!"
            WScript.Quit
        EndIf
    Next
    strArr=Split(str,",")
    For i=0ToUBound(strArr)
        For j=0ToUBound(strArr)
            If strArr(i)>strArr(j) Then
                t=strArr(i)
                strArr(i)=strArr(j)
                strArr(j)=t
            EndIf
        Next
    Next
    reversestr=Join(strArr,"")
EndFunction

数字排序

标签:io   ar   sp   for   on   cti   amp   as   new   

原文地址:http://www.cnblogs.com/futrueface/p/4123227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!