冒泡排序:
class BubbleTest
{
public static void main(String[] args)
{
int[] arr={99,22,33,-15,0};
for (int i=0;i
for (int j=0;j
if (arr[j]
{
int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
for (int a:arr)
{
System.out.println(a);
}
System.out.println();
}
}