????????????????м???????????????????????????????????Щ???????????????????????????ε???????ü???????????Σ???????У????????????????????????Щ??????????????????У???????????е???????????????????????μ?????????????????飬?ú??????????Щ?????????????????????????????????????????????????????????????????????????????java???????????C?????C++????????????????????????????????????e????????????????????
????e????????????????????д????????????????????????ɡ?
????package com.Arithmetic.chapter1;
????import java.util.Random;
????/**
????*
????* @????????Arithmetic
????* @???????Sort
????* @???????[czc] 
????* @???????2016-10-20????06:30:55
????*/
????public class Sort {
????public static void main(String[] args) {
????Random random = new Random();
????int [] sort = new int[10];
????for (int i = 0; i < sort.length; i++) {
????sort[i] = random.nextInt(50);
????}
????System.out.println("??????????????");
????for(int i:sort){
????System.out.print(i+" ");
????}
????//bubbleSort(sort);
????selectSort(sort);
????System.out.println();
????System.out.println("?????????????");
????for (int i = 0; i < sort.length; i++) {
????System.out.print(sort[i]+" ");
????}
????}
????/**
????* e??????
????* ???α?????????????????С????????棬???????????
????* @param sort
????*/
????public static void bubbleSort(int [] sort){
????for(int i = 1;i<=sort.length;i++){
????for (int j = 0; j < sort.length-i; j++) {
????if (sort[j]>sort[j+1]) {
????int temp = sort[j+1];
????sort[j+1] = sort[j];
????sort[j] = temp;
????}
????}
????}
????}
????/**
????* ???????
????* ??????????????????????С????????????????????????е??????????????????????????.
????* @param sort
????*/
????public static void selectSort(int [] sort){
????for (int i = 0; i < sort.length-1; i++) {
????for (int j = i+1; j < sort.length; j++) {
????if (sort[j]<sort[i]) {
????int temp = sort[i];
????sort[i] = sort[j];
????sort[j] = temp;
????}
????}
????}
????}  
????}
????????????Щ???????????????????в??????????????????????????????????????д????????????????????????????