|
|
|
|
#include<stdio.h>
|
|
|
|
|
void sortexam(int b[],int f[],float c[],float d[],float e[],float g[],int h,int n)/*<2A>༶<EFBFBD>ڳɼ<DAB3><C9BC><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
{
|
|
|
|
|
int i,j;
|
|
|
|
|
int t=0;
|
|
|
|
|
float k=0;
|
|
|
|
|
for(i=h;i<=n;i++)/*ð<><C3B0>*/
|
|
|
|
|
for(j=h;j<=n-i;j++)
|
|
|
|
|
{
|
|
|
|
|
if(g[j]<g[j+1])
|
|
|
|
|
{
|
|
|
|
|
t=b[j];
|
|
|
|
|
b[j]=b[j+1];
|
|
|
|
|
b[j+1]=t;
|
|
|
|
|
k=c[j];
|
|
|
|
|
c[j]=c[j+1];
|
|
|
|
|
c[j+1]=k;
|
|
|
|
|
k=d[j];
|
|
|
|
|
d[j]=d[j+1];
|
|
|
|
|
d[j+1]=k;
|
|
|
|
|
k=e[j];
|
|
|
|
|
e[j]=e[j+1];
|
|
|
|
|
e[j+1]=k;
|
|
|
|
|
k=g[j];
|
|
|
|
|
g[j]=g[j+1];
|
|
|
|
|
g[j+1]=k;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void sortclass(int b[],int f[],float c[],float d[],float e[],float g[],int n)/*<2A>༶<EFBFBD><E0BCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
{
|
|
|
|
|
int i,j;
|
|
|
|
|
int t=0;
|
|
|
|
|
float k=0;
|
|
|
|
|
for(i=1;i<=n;i++)/*ð<><C3B0>*/
|
|
|
|
|
for(j=1;j<=n-i;j++)
|
|
|
|
|
{
|
|
|
|
|
if(f[j]>f[j+1])
|
|
|
|
|
{
|
|
|
|
|
t=f[j];/*<2A><><EFBFBD><EFBFBD>*/
|
|
|
|
|
f[j]=f[j+1];
|
|
|
|
|
f[j+1]=t;
|
|
|
|
|
t=b[j];
|
|
|
|
|
b[j]=b[j+1];
|
|
|
|
|
b[j+1]=t;
|
|
|
|
|
k=c[j];
|
|
|
|
|
c[j]=c[j+1];
|
|
|
|
|
c[j+1]=k;
|
|
|
|
|
k=d[j];
|
|
|
|
|
d[j]=d[j+1];
|
|
|
|
|
d[j+1]=k;
|
|
|
|
|
k=e[j];
|
|
|
|
|
e[j]=e[j+1];
|
|
|
|
|
e[j+1]=k;
|
|
|
|
|
k=g[j];
|
|
|
|
|
g[j]=g[j+1];
|
|
|
|
|
g[j+1]=k;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int k;
|
|
|
|
|
int b[1001]={0,10001,10002,10003},f[1001]={0,11,12,11};/*<2A>༶*/
|
|
|
|
|
float c[1001]={0,99.5,77.9,92.5},d[1001]={0,88.5,56.5,99.0},e[1001]={0,89.5,87.5,60.5};
|
|
|
|
|
float g[1001]={0};/*<2A>ܳɼ<DCB3>*/
|
|
|
|
|
int sign=0;/*<2A><><EFBFBD><EFBFBD>*/
|
|
|
|
|
scanf("%d%d%f%f%f",&b[4],&f[4],&c[4],&d[4],&e[4]);
|
|
|
|
|
sign=b[4];
|
|
|
|
|
for(i=1;i<=4;i++)
|
|
|
|
|
g[i]=c[i]+d[i]+e[i];
|
|
|
|
|
sortclass(b,f,c,d,e,g,4);
|
|
|
|
|
k=1;/*ǰ<><C7B0>*/
|
|
|
|
|
for(i=1;i<=4;i++)
|
|
|
|
|
{
|
|
|
|
|
if(f[i+1]!=f[k])
|
|
|
|
|
{
|
|
|
|
|
sortexam(b,f,c,d,e,g,k,i);
|
|
|
|
|
k=i+1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(i=1;i<=4;i++)
|
|
|
|
|
{
|
|
|
|
|
printf("%d %d %.1f %.1f %.1f",b[i],f[i],c[i],d[i],e[i]);
|
|
|
|
|
if(b[i]==sign)
|
|
|
|
|
printf(" inserted");
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|