#include
#include
#include
#include
#include
#define n 2
#define m 1
#define w 1
#define null 0
struct itemnode{
int itemnum;
int top;
int range[5];
int mark[5];
char name[8];
};
struct headnode{
int schoolnum;
int score;
int mscore;
int wscore;
struct itemnode c[m+w];
};struct headnode h[n];
void inputinformation()
{
int i,j,k,s;
char ch;
for(i=0;i
{
h[i].score=0;
h[i].mscore=0;
h[i].wscore=0;
printf("====参赛学校编号:");
scanf("%d",&h[i].schoolnum);
for(j=0;j
{
printf(" 参赛项目编号:");
scanf("%d",&h[i].c[j].itemnum);
printf(" 取前3名or前5名:");
scanf("%d",&h[i].c[j].top);
printf(" 所取名次数量:");
scanf("%d",&k);
for(s=0;s
{
h[i].c[j].range[s]=0;
h[i].c[j].mark[s]=0;
printf(" 所获得的名次:");
scanf("%d",&h[i].c[j].range[s]);
printf(" 该运动员姓名:");
ch=getchar();
gets(h[i].c[j].name);
if(h[i].c[j].top==3)
switch(h[i].c[j].range[s])
{
case 0: h[i].c[j].mark[s]=0; break;
case 1: h[i].c[j].mark[s]=5; break;
case 2: h[i].c[j].mark[s]=3; break;
case 3: h[i].c[j].mark[s]=2; break;
}
else
switch(h[i].c[j].range[s])
{
case 0: h[i].c[j].mark[s]=0; break;
case 1: h[i].c[j].mark[s]=7; break;
case 2: h[i].c[j].mark[s]=5; break;
case 3: h[i].c[j].mark[s]=3; break;
case 4: h[i].c[j].mark[s]=2; break;
case 5: h[i].c[j].mark[s]=1; break;
}
h[i].score=h[i].score+h[i].c[j].mark[s];