int d(int score[])
{
int i,j,m;
for(i=9;i>=0;i--)
{
for(j=0;j<i;j++)
{
if(score[j]<score[j+1])
{
m=score[j+1];
score[j+1]=score[j];
score[j]=m;
}
}
}
return score;
}
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
d(score);
printf("平时考试成绩降序排序:);
for(i=0;i<10;i++)
{
if(i!=9)
printf("%d,",score[i]);
else
printf("%d",score[i]);
}
return 0;
}
#include<stdio.h>
int i,j,m;
int d(int score[])
{
for(i=9;i>=0;i--)
{
for(j=0;j<i;j++)
{
if(score[j]<score[j+1])
{
m=score[j+1];
score[j+1]=score[j];
score[j]=m;
}
}
} return 0;
}
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
printf("\n平时考试成绩降序排序:\n");
d(score);
for(i=0;i<10;i++)
{
if(i!=9)
printf("%d,",score[i]);
else
printf("%d",score[i]);
}
return 0;
}
/*这是修改过的,你看一下。你的小问题很多。*/