rt,明天项目就要交付了,在线等啊,大侠救命啊。

解决方案 »

  1.   

    这么简单的问题,网上一大堆啊,不知道楼主在想什么。。
    public class MaoPaoSort {
    public static void main(String[] args) {
    try {
    int mp[] = new int[args.length];
    for (int i = 0; i < args.length; i++) {
    mp[i] = Integer.parseInt(args[i]);
    }
    for (int i = 0; i < mp.length; i++) {
    for (int j = 0; j < mp.length; j++) {
    int temp;
    if (mp[i] < mp[j]) {
    temp = mp[j];
    mp[j] = mp[i];
    mp[i] = temp;
    }
    }
    }
    for (int i = 0; i < mp.length; i++) {
    System.out.print(mp[i] + " ");
    }
    System.out.print("\n");
    System.out.println("你的名字写在这里");
    System.out.println("你的班级写在这里");
    System.out.println("你的学号写在这里");
    } catch (Exception e) {
    System.out.println("没有传递参数或者参数类型不正确!请按照规则输入参数!程序退出...");
    }
    }
    }
      

  2.   


    你还可以看看我这里或许有比冒泡更好的方法
    http://blog.csdn.net/huiwenjie168/article/details/7252919
      

  3.   

    @Test//冒泡排序
    public void testMethord(){
    int[] buf = {1,5,2,4,7,0,9,3};
    // int[] buf = getBuf(10);
    for(int j=1;j<buf.length;j++){
    for(int i=0;i<buf.length-j;i++){
    if(buf[i]>buf[i+1]){
    int temp = buf[i];
    buf[i]=buf[i+1];
    buf[i+1]=temp;
    }
    }
    }
    }