int [] ary={9,5,7,-4,3,-2,10}; for (int i=0;i<ary.length;i++) { for (int j=i+1;j<ary.length;j++) { if(ary[i]<ary[j]) { int temp=ary[i]; ary[i]=ary[j]; ary[j]=temp; } } } for (int i=0;i<ary.length;i++) { System.out.print(ary[i]+" "); }
posted on 2016-05-10 13:26 煜渝 阅读(138) 评论(0) 编辑 收藏 举报