冒泡排序

void  bubbleSort(int A[],int N)
{
    int i,j;
    for(i=0;i<N;i++)
    {
        for(j=0;j<N-i-1;j++)
        {
            if(A[j]>A[j+1])
            {
                int tmp=A[j+1];
                A[j+1]=A[j];
                A[j]=tmp;
            }
        }
    }
}
原文地址:https://www.cnblogs.com/angury/p/13022340.html