About

<#TEMPLATE_INCLUDE_NINEPAGE_ABOUTME#>
  • Feb

    25

    下载链接:Flash与ASP.rar

    Feb

    21

    var _array:Array = ["1-10", "6", "24-28", "2-11", "14-16", "28"];
    var all_number_array:Array = new Array();
    for (var i:Number = 0; i<_array.length; i++) {
    var temp_array:Array = new Array();
    _array[i] = _array[i].split("-");
    if (_array[i].length == 2) {
      for (var j:Number = Number(_array[i][0]); j<=Number(_array[i][1]); j++) {
       temp_array.push(j);
      }
    } else if (_array[i].length == 1) {
      _array[i] = Number(_array[i].toString());
      temp_array = _array[i];
    }
    _array[i] = temp_array;
    trace("第"+i+"组: "+_array[i]);
    all_number_array = all_number_array.concat(_array[i]);
    }
    delete temp_array;
    trace("\n");
    trace("总 组: "+all_number_array);
    all_number_array.sort(1,Array.NUMERIC);
    trace("排 序: "+all_number_array);
    for (var i:Number = 0; i<all_number_array.length; i++) {
    if (all_number_array[i] == all_number_array[i+1]) {
      all_number_array[i] = "";
    }
    }
    var temp_array:Array = new Array();
    for (var i:Number = 0; i<all_number_array.length; i++) {
    if (all_number_array[i] != "") {
      temp_array.push(all_number_array[i]);
    }
    }
    all_number_array = temp_array;
    delete temp_array;
    trace("简 化: "+all_number_array);

    //以下为输出结果:
    //
    第0组: 1,2,3,4,5,6,7,8,9,10
    第1组: 6
    第2组: 24,25,26,27,28
    第3组: 2,3,4,5,6,7,8,9,10,11
    第4组: 14,15,16
    第5组: 28


    总 组: 1,2,3,4,5,6,7,8,9,10,6,24,25,26,27,28,2,3,4,5,6,7,8,9,10,11,14,15,16,28
    排 序: 1,2,2,3,3,4,4,5,5,6,6,6,7,7,8,8,9,9,10,10,11,14,15,16,24,25,26,27,28,28
    简 化: 1,2,3,4,5,6,7,8,9,10,11,14,15,16,24,25,26,27,28