69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <string.h>
void f32(int R[8],int n){ //R[8]可写成*R或R[]
int i,t;
for(i=0;i <n;i++)
while(R[i]!=i){
t=R[R[i]];
R[R[i]]=R[i];
R[i]=t; }
}
void main()
{ int i;
int r[8]={3,0,5,1,6,4,2,7};
f32(r,8); //修改
for (i=0;i <8;i++){
printf("%d",r[i]);}
}