int a[] = {}; // 숫자를 넣어놈

int n;

for(int i=1 ; i<=n ; i++)

{

if(a[i]>a[i+1])

{

swap(i,i+1);

i = 0

}

}


대신 운이 좋아야 O(N)임