展开全部
收起
4回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Zavier

    59人对此回答表示赞同


    '将下列代码保存到一个文本文档中然后将后缀名改为vbs即可执行:
    Dim i, int1(3), str1(3), s
    int1(0) = 22
    int1(1) = 14
    int1(2) = 6
    int1(3) = 13
    Call sortFigu(int1)'调用过程进行处理
    For i = LBound(int1) To UBound(int1)
        s = s & CStr(int1(i)) & " "
    Next
    MsgBox s'显示int1排序后的结果

    str1(0) = "d"
    str1(1) = "a"
    str1(2) = "j"
    str1(3) = "b"
    Call sorString(str1)'调用过程进行处理
    s = ""
    For i = LBound(str1) To UBound(str1)
        s = s & CStr(str1(i)) & " "
    Next
    MsgBox s'显示str1排序后的结果

    Private Sub sortFigu(ByRef int1)'数字数组升序排序
        Dim i, j, temp
        For i = LBound(int1) To UBound(int1)
            For j = i To UBound(int1)
                If int1(i) > int1(j) Then
                    temp = int1(i)
                    int1(i) = int1(j)
                    int1(j) = temp
                End If
            Next
        Next
    End Sub

    Private Sub sorString(ByRef str1)'字符数组降序排序
        Dim i, j,temp
        For i = LBound(str1) To UBound(str1)
            For j = i To UBound(str1)
                If str1(i) < str1(j) Then
            
    展开
    59
    0回复
    发布于 7年前

    评论(0)

    收起评论

  • Piper

    59人对此回答表示赞同

    这个在数据表里可以排列。然后按照编号来排出显示。
    也可以在程序里写出。
    sql = "select * from txgz order by id"
    这个后面就是按编号排列。
    展开
    59
    0回复
    发布于 8年前

    评论(0)

    收起评论

  • Luz鹿糍

    59人对此回答表示赞同

    function BubbleSort(arr) { //交换排序->冒泡排序
    var st = new Date();
    var temp;
    var exchange;
    for(var i=0; i<arr.length; i++) {
    exchange = false;
    for(var j=arr.length-2; j>=i; j--) {
    if((arr[j+1]) < (arr[j])) {
    temp = arr[j+1];
    arr[j+1] = arr[j];
    arr[j] = temp;
    exchange = true;
    }
    }
    if(!exchange) break;
    }
    status = (new Date() - st) + ' ms';
    return arr;
    }

    var a=new Array(6,4,5,3);

    BubbleSort(a);

    for (i=0;i<a.length;i++)
    alert(a[i]);
    展开
    59
    0回复
    发布于 8年前

    评论(0)

    收起评论

  • 李振藩

    59人对此回答表示赞同

    不知你是怎么排的,一般是用数组和冒泡算法来排
    展开
    59
    0回复
    发布于 8年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部