大佬求助,为什么编译死循环了(是一个排序的代码)
int main(){
int px[5] = { 5,6,2,4,0};
int left = 0;
int right = sizeof(px) / sizeof(px[1]) - 1;
int right1= sizeof(px) / sizeof(px[1]) - 1;
while (left != right1)
{
if (px[left] < px[right])
{
int tem;
tem = px[right];
px[right] = px[left];
px[left] = tem;
right=right-1;
}
if (right == left)
{
left=left+1;
right = right1;
}
}
printf("%d%d%d%d%d", px[0], px[1], px[2],px[3],px[4]);
return 0;