JAVA---冒泡排序


package lll;

public class Test {
	public static void main(String[] args) {
		int[] arr=new int[]{-11,-22,-3,0,23,2,4,6};
		int temp=0;
		//需要执行多少轮
		for(int i=0;iarr[j+1]){
					temp=arr[j];
					arr[j]=arr[j+1];
					arr[j+1]=temp;
				}
			}
		}
		//输出
		for(int i=0;i