void me(int *pa,int count){
int p;
int right = count -1;
int left =1;
int t;
do{
for(int i = right ;i>=left; i--){
if(pa[i] > pa[i-1]){
t=pa[i];
pa[i]=pa[i-1];
pa[i-1]=t;
p=i;
}
}
left = p+1;
for(int i= left; i<right+1;i++){
if(pa[i] < pa[i+1]){
t=pa[i];
pa[i]=pa[i+1];
pa[i+1]=t;
p=i;
}
}
right = p-1;
}while(left =< right);
}
void main(){
int pa[]={6,4,7,3,5,2,10};
me(pa,7);
for(int i=0; i<7;i++)
printf("%d/n",pa[i]);
}
错了,无解