void descendingSortByScore(long num[ ],char name[ ][M],int score[],int n)
{
int i,j,k,temp1;
long temp2;
char temp3[M];
for(i=0;i
{
for(j=i+1;j
{
if (score[i]
{temp1=score[i];score[i]=score[j];score[j]=temp1;
temp2=num[i];num[i]=num[j];num[j]=temp2
… }
}
}
姓名交换怎么写
用strcpy进行字符串复制交换
char t[100] = {0};
if (score[i]<score[j])
{temp1=score[i];score[i]=score[j];score[j]=temp1;
temp2=num[i];num[i]=num[j];num[j]=temp2;
strcpy(t,name[i]);
strcpy(name[i],name[j]);
strcpy(name[j],t);
}