编写一个对n个数据从大到小的排序C函数,再编写一个计算最后得分的C函数,计算方法是除一个最低分,:
(2013-04-15 21:17:40)
标签:
杂谈 |
# include "stdio.h"
# define N 3
# define M 4
main()
{ int d[N][M],i,j,k,x;
float t[N];
printf("please input:");
for(i=0;i
for(j=0;j
scanf("%d",&d[i][j]);
jun(d,t);
for(k=0;k
for(j=k+1;j
if(t[j]
{ x=t[k];
t[k]=t[j];
t[j]=x;
}
printf("结果为:\n");
for(k=0;k
printf("_ ",t[k]);
printf("\n");
}
int jun(int d[N][M],float t[N])
{ int i,j,y,k;
float sum=0;
for(i=0;i
{
for(j=0;j
for(k=j+1;k
if(d[i][k]
{ y=d[i][k];
d[i][k]=d[i][j];
d[i][j]=y;
}
sum=0;
for(j=1;j
sum+=d[i][j];
t[i]=sum/(M-2);
}
}
# define N 3
# define M 4
main()
{
}
int jun(int d[N][M],float t[N])
{
}