导读 运动会分数统计程序 C++ 功能还算齐全,觉得可以加分啊! switch运动会 Switch运动会打折吗 #include #include #include #incl

运动会分数统计程序 C++

功能还算齐全,觉得可以加分啊!

switch运动会 Switch运动会打折吗switch运动会 Switch运动会打折吗


#include

#include

#include

#include

using namespace std;

int n; //n个学校

int m; //m个男子项目

int w; //w个女子项目

struct pro //表示项目的结构体

{string name; //项目名称

int snum[6]; //前5名学校的编号

}p[21];

struct school //表示学校的结构体

{int num;

string name; //学校名称

int score; //学校总分

int male; //男子总分

int female; //女子总分

}sch[21];

int integral[5]=;//前五名得分

void input()

{int i,j,y,x;

printf("输入学校数目:");

y=0;

while(1)

{scanf("%d",&n);

if(n>=1&&n<=20)y=1;

if(y)break;

else printf("输入数据有误,请重新输入:");

}for(i=1;i<=n;i++)

{printf("输入第%d个学校的名称:",i);

cin>>sch[i].name;

sch[i].score=0;

sch[i].female=0;

sch[i].male=0;

sch[i].num=i;

}printf("输入男子项目数和女子项目数:");

y=0;

while(1)

{scanf("%d%d",&m,&w);

if(m<=20&&m>=1&&w<=20&&w>=1)y=1;

if(y)break;

else printf("输入数据有误,请重新输入:");

}for(i=1;i<=m+w;i++)

{printf("输入第%d个项目的名称:\n",i);

cin>>p[i].name;

printf("输入第%d个项目的前5名的学校编号:\n",i);

for(j=1;j<=5;j++)

{y=0;

while(1)

{scanf("%d",&x);

if(x>=1&&x<=20)y=1;

if(y)break;

else printf("输入数据有误,请重新输入:");

}p[i].snum[j]=x;

sch[x].score+=integral[j-1];

if(i<=m)sch[x].male+=integral[j-1];

else sch[x].female+=integral[j-1];

}}

}void print(int i)

{cout<

<

}void bianhao() //按编号排序

{int i,j;

school t;

for(i=1;i

{for(j=i;j<=n;j++)

if(sch[i].num>sch[j].num)

}printf("\n按编号排列:\n");

printf("编号 学校名称 总分 男子总分 女子总分\n");

for(i=1;i<=n;i++)

print(i);

}void zongfen() //按学校总分排序

{int i,j;

school t;

for(i=1;i

{for(j=i;j<=n;j++)

if(sch[i].score

}printf("\n按学校总分排列:\n");

printf("编号 学校名称 总分 男子总分 女子总分\n");

for(i=1;i<=n;i++)

print(i);

ofstream fout;

fout.open("运动会分数统计.txt");

fout<<"编号 学校名称 总分 男子总分 女子总分"<

for(i=1;i<=n;i++)

{fout<

<

fout.close();

}void malezf() //按学校男总分排序

{int i,j;

school t;

for(i=1;i

{for(j=i;j<=n;j++)

if(sch[i].male

}printf("\n按学校男子总分排列:\n");

printf("编号 学校名称 总分 男子总分 女子总分\n");

for(i=1;i<=n;i++)

print(i);

}void femalezf() //按学校女总分排序

{int i,j;

school t;

for(i=1;i

{for(j=i;j<=n;j++)

if(sch[i].female

}printf("\n按学校女子总分排列:\n");

printf("编号 学校名称 总分 男子总分 女子总分\n");

for(i=1;i<=n;i++)

print(i);

cout<

}void cxsch() //查询学校信息

{int i,y,s;

printf("输入需要查询的学校编号:");

y=0;

while(1)

{scanf("%d",&s);

if(s>=1&&s<=n)y=1;

if(y)break;

else printf("输入数据有误,请重新输入:");

}printf("该学校相关信息:\n");

printf("编号 学校名称 总分 男子总分 女子总分\n");

for(i=1;i<=n;i++)

{if(sch[i].num==s)

{print(i);

break;

}}

cout<

}void cxxm() //查询项目信息

{int i,y,s;

printf("输入需要查询的项目编号:");

y=0;

while(1)

{scanf("%d",&s);

if(s>=1&&s<=n)y=1;

if(y)break;

else printf("输入数据有误,请重新输入:");

}cout<

printf("名次 编号 学校名称\n");

for(i=1;i<=5;i++)

cout<<" "<

cout<

}void solve() //菜单函数

{int z;

while(1)

{printf("\n选择您需要的操作(选择序号):\n");

printf("1.按学校编号排序输出\n");

printf("2.按学校总分排序输出\n");

printf("3.按学校男总分排序输出\n");

printf("4.按学校女总分排序输出\n");

printf("5.查询某个学校成绩\n");

printf("6.查询某个项目成绩\n");

printf("7.结束\n\n");

scanf("%d",&z);

if(z==1)bianhao();

if(z==2)zongfen();

if(z==3)malezf();

if(z==4)femalezf();

if(z==5)cxsch();

if(z==6)cxxm();

if(z==7)break;

}}

int main() //主函数

{input();

solve();

return 0;

}

#include

#include

#include

#include

#define NULL 0

#define MaxSize 30

typedef struct athletestruct /*运动员*/

{char name[20];

int score; /*分数*/

int range; /**/

int item; /*项目*/

}ATH;

typedef struct schoolstruct /*学校*/

{int count; /*编号*/

int serial; /**/

int menscore; /*男选手分数*/

int womenscore; /*女选手分数*/

int totalscore; /*总分*/

ATH athlete[MaxSize]; /**/

struct schoolstruct *next;

}SCH;

int nsc,msp,wsp;

int ntsp;

int i,j;

int overgame;

int serial,range;

int n;

SCH *head,*pfirst,*psecond;

int *phead=NULL,*pafirst=NULL,*pasecond=NULL;

input ()

{char answer;

head = (SCH *)malloc(sizeof(SCH)); /**/

head->next = NULL;

pfirst = head;

answer = 'y';

while ( answer == 'y' )

{Is_Game_DoMain:

printf("\nGET Top 5 when odd\nGET Top 3 when even");

printf("\n输入运动项目序号 (x<=%d):",ntsp);

scanf("%d",pafirst);

overgame = *pafirst;

if ( pafirst != phead )

{for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )

{if ( overgame == *pasecond )

{printf("\n这个项目已经存在请选择其他的数字\n");

goto Is_Game_DoMain;

}}

}pafirst = pafirst + 1;

if ( overgame > ntsp )

{printf("\n项目不存在");

printf("\n请重新输入");

goto Is_Game_DoMain;

}switch ( overgame%2 )

{case 0: n = 3;break;

case 1: n = 5;break;

}for ( i = 1 ; i <= n ; i++ )

{Is_Serial_DoMain:

printf("\n输入序号 of the NO.%d (0

scanf("%d",&serial);

if ( serial > nsc )

{printf("\n超过学校数目,请重新输入");

goto Is_Serial_DoMain;

}if ( head->next == NULL )

{create();

}psecond = head->next ;

while ( psecond != NULL )

{if ( psecond->serial == serial )

{pfirst = psecond;

pfirst->count = pfirst->count + 1;

goto Store_Data;

}else

{psecond = psecond->next;

}}

create();

Store_Data:

pfirst->athlete[pfirst->count].item = overgame;

pfirst->athlete[pfirst->count].range = i;

pfirst->serial = serial; ("Input name:) : ");

scanf("%s",pfirst->athlete[pfirst->count].name);

}printf("\n继续输入运动项目(y&n)?");

answer = getch();

printf("\n");

}}

calculate() /**/

{pfirst = head->next;

while ( pfirst->next != NULL )

{for (i=1;i<=pfirst->count;i++)

{if ( pfirst->athlete[i].item % 2 == 0 )

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 5;break;

case 2:pfirst->athlete[i].score = 3;break;

case 3:pfirst->athlete[i].score = 2;break;

}}

else

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 7;break;

case 2:pfirst->athlete[i].score = 5;break;

case 3:pfirst->athlete[i].score = 3;break;

case 4:pfirst->athlete[i].score = 2;break;

case 5:pfirst->athlete[i].score = 1;break;

}}

if ( pfirst->athlete[i].item <=msp )

{pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;

}else

{pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;

}}

pfirst->totalscore = pfirst->menscore + pfirst->womenscore;

pfirst = pfirst->next;

}}

output()

{pfirst = head->next;

psecond = head->next;

while ( pfirst->next != NULL )

{clrscr();

printf("\n第%d号学校的结果成绩:",pfirst->serial);

printf("\n\n项目的数目\t学校的名字\t分数");

for (i=1;i<=ntsp;i++)

{for (j=1;j<=pfirst->count;j++)

{if ( pfirst->athlete[j].item == i )

{printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;

}}

}printf("\n\n\n\t\t\t\t\t\t按任意建 进入下一页");

getch();

pfirst = pfirst->next;

}clrscr();

printf("\n运动会结果:\n\n学校编号\t男运动员成绩\t女运动员成绩\t总分");

pfirst = head->next;

while ( pfirst->next != NULL )

{printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);

pfirst = pfirst->next;

}printf("\n\n\n\t\t\t\t\t\t\t按任意建结束");

getch();

}create()

{pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));

pfirst->next = head->next ;

head->next = pfirst ;

pfirst->count = 1;

pfirst->menscore = 0;

pfirst->womenscore = 0;

pfirst->totalscore = 0;

}void Save()

{FILE *fp;

if((fp = fopen("school.dat","wb"))==NULL)

{printf("can't open school.dat\n");

fclose(fp);

return;

}fwrite(pfirst,sizeof(SCH),10,fp);

fclose(fp);

printf("文件已经成功保存\n");

}main()

{system("cls");

printf("\n\t\t\t 运动会分数统计\n");

printf("输入学校数目 (x>= 5):");

scanf("%d",&nsc);

printf("输入男选手的项目(x<=20):");

scanf("%d",&msp);

printf("输入女选手项目(<=20):");

scanf("%d",&wsp);

ntsp = msp + wsp;

phead = calloc(ntsp,sizeof(int));

pafirst = phead;

pasecond = phead;

input();

calculate();

output();

Save();

}

#include

#include

#include

using namespace std;

class School{

private:

C++相关 运动会分数统计程序

#include

#include

#include

#include

#define NULL 0

#define MaxSize 30

typedef struct athletestruct /*运动员*/

{char name[20];

int score; /*分数*/

int range; /**/

int item; /*项目*/

}ATH;

typedef struct schoolstruct /*学校*/

{int count; /*编号*/

int serial; /**/

int menscore; /*男选手分数*/

int womenscore; /*女选手分数*/

int totalscore; /*总分*/

ATH athlete[MaxSize]; /**/

struct schoolstruct *next;

}SCH;

int nsc,msp,wsp;

int ntsp;

int i,j;

int overgame;

int serial,range;

int n;

SCH *head,*pfirst,*psecond;

int *phead=NULL,*pafirst=NULL,*pasecond=NULL;

input ()

{char answer;

head = (SCH *)malloc(sizeof(SCH)); /**/

head->next = NULL;

pfirst = head;

answer = 'y';

while ( answer == 'y' )

{Is_Game_DoMain:

printf("\nGET Top 5 when odd\nGET Top 3 when even");

printf("\n输入运动项目序号 (x<=%d):",ntsp);

scanf("%d",pafirst);

overgame = *pafirst;

if ( pafirst != phead )

{for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )

{if ( overgame == *pasecond )

{printf("\n这个项目已经存在请选择其他的数字\n");

goto Is_Game_DoMain;

}}

}pafirst = pafirst + 1;

if ( overgame > ntsp )

{printf("\n项目不存在");

printf("\n请重新输入");

goto Is_Game_DoMain;

}switch ( overgame%2 )

{case 0: n = 3;break;

case 1: n = 5;break;

}for ( i = 1 ; i <= n ; i++ )

{Is_Serial_DoMain:

printf("\n输入序号 of the NO.%d (0

scanf("%d",&serial);

if ( serial > nsc )

{printf("\n超过学校数目,请重新输入");

goto Is_Serial_DoMain;

}if ( head->next == NULL )

{create();

}psecond = head->next ;

while ( psecond != NULL )

{if ( psecond->serial == serial )

{pfirst = psecond;

pfirst->count = pfirst->count + 1;

goto Store_Data;

}else

{psecond = psecond->next;

}}

create();

Store_Data:

pfirst->athlete[pfirst->count].item = overgame;

pfirst->athlete[pfirst->count].range = i;

pfirst->serial = serial; ("Input name:) : ");

scanf("%s",pfirst->athlete[pfirst->count].name);

}printf("\n继续输入运动项目(y&n)?");

answer = getch();

printf("\n");

}}

calculate() /**/

{pfirst = head->next;

while ( pfirst->next != NULL )

{for (i=1;i<=pfirst->count;i++)

{if ( pfirst->athlete[i].item % 2 == 0 )

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 5;break;

case 2:pfirst->athlete[i].score = 3;break;

case 3:pfirst->athlete[i].score = 2;break;

}}

else

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 7;break;

case 2:pfirst->athlete[i].score = 5;break;

case 3:pfirst->athlete[i].score = 3;break;

case 4:pfirst->athlete[i].score = 2;break;

case 5:pfirst->athlete[i].score = 1;break;

}}

if ( pfirst->athlete[i].item <=msp )

{pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;

}else

{pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;

}}

pfirst->totalscore = pfirst->menscore + pfirst->womenscore;

pfirst = pfirst->next;

}}

output()

{pfirst = head->next;

psecond = head->next;

while ( pfirst->next != NULL )

{clrscr();

printf("\n第%d号学校的结果成绩:",pfirst->serial);

printf("\n\n项目的数目\t学校的名字\t分数");

for (i=1;i<=ntsp;i++)

{for (j=1;j<=pfirst->count;j++)

{if ( pfirst->athlete[j].item == i )

{printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;

}}

}printf("\n\n\n\t\t\t\t\t\t按任意建 进入下一页");

getch();

pfirst = pfirst->next;

}clrscr();

printf("\n运动会结果:\n\n学校编号\t男运动员成绩\t女运动员成绩\t总分");

pfirst = head->next;

while ( pfirst->next != NULL )

{printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);

pfirst = pfirst->next;

}printf("\n\n\n\t\t\t\t\t\t\t按任意建结束");

getch();

}create()

{pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));

pfirst->next = head->next ;

head->next = pfirst ;

pfirst->count = 1;

pfirst->menscore = 0;

pfirst->womenscore = 0;

pfirst->totalscore = 0;

}void Save()

{FILE *fp;

if((fp = fopen("school.dat","wb"))==NULL)

{printf("can't open school.dat\n");

fclose(fp);

return;

}fwrite(pfirst,sizeof(SCH),10,fp);

fclose(fp);

printf("文件已经成功保存\n");

}main()

{system("cls");

printf("\n\t\t\t 运动会分数统计\n");

printf("输入学校数目 (x>= 5):");

scanf("%d",&nsc);

printf("输入男选手的项目(x<=20):");

scanf("%d",&msp);

printf("输入女选手项目(<=20):");

scanf("%d",&wsp);

ntsp = msp + wsp;

phead = calloc(ntsp,sizeof(int));

pafirst = phead;

pasecond = phead;

input();

calculate();

output();

Save();

}

c语言程序设计题。实验报告。高分。

运动会分数统计

#include

#include

#include

#include

#define NULL 0

#define MaxSize 30

typedef struct athletestruct /*运动员*/

{char name[20];

int score; /*分数*/

int range; /**/

int item; /*项目*/

}ATH;

typedef struct schoolstruct /*学校*/

{int count; /*编号*/

int serial; /**/

int menscore; /*男选手分数*/

int womenscore; /*女选手分数*/

int totalscore; /*总分*/

ATH athlete[MaxSize]; /**/

struct schoolstruct *next;

}SCH;

int nsc,msp,wsp;

int ntsp;

int i,j;

int overgame;

int serial,range;

int n;

SCH *head,*pfirst,*psecond;

int *phead=NULL,*pafirst=NULL,*pasecond=NULL;

input ()

{char answer;

head = (SCH *)malloc(sizeof(SCH)); /**/

head->next = NULL;

pfirst = head;

answer = 'y';

while ( answer == 'y' )

{Is_Game_DoMain:

printf("\nGET Top 5 when odd\nGET Top 3 when even");

printf("\n输入运动项目序号 (x<=%d):",ntsp);

scanf("%d",pafirst);

overgame = *pafirst;

if ( pafirst != phead )

{for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )

{if ( overgame == *pasecond )

{printf("\n这个项目已经存在请选择其他的数字\n");

goto Is_Game_DoMain;

}}

}pafirst = pafirst + 1;

if ( overgame > ntsp )

{printf("\n项目不存在");

printf("\n请重新输入");

goto Is_Game_DoMain;

}switch ( overgame%2 )

{case 0: n = 3;break;

case 1: n = 5;break;

}for ( i = 1 ; i <= n ; i++ )

{Is_Serial_DoMain:

printf("\n输入序号 of the NO.%d (0

scanf("%d",&serial);

if ( serial > nsc )

{printf("\n超过学校数目,请重新输入");

goto Is_Serial_DoMain;

}if ( head->next == NULL )

{create();

}psecond = head->next ;

while ( psecond != NULL )

{if ( psecond->serial == serial )

{pfirst = psecond;

pfirst->count = pfirst->count + 1;

goto Store_Data;

}else

{psecond = psecond->next;

}}

create();

Store_Data:

pfirst->athlete[pfirst->count].item = overgame;

pfirst->athlete[pfirst->count].range = i;

pfirst->serial = serial; ("Input name:) : ");

scanf("%s",pfirst->athlete[pfirst->count].name);

}printf("\n继续输入运动项目(y&n)?");

answer = getch();

printf("\n");

}}

calculate() /**/

{pfirst = head->next;

while ( pfirst->next != NULL )

{for (i=1;i<=pfirst->count;i++)

{if ( pfirst->athlete[i].item % 2 == 0 )

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 5;break;

case 2:pfirst->athlete[i].score = 3;break;

case 3:pfirst->athlete[i].score = 2;break;

}}

else

{switch (pfirst->athlete[i].range)

{case 1:pfirst->athlete[i].score = 7;break;

case 2:pfirst->athlete[i].score = 5;break;

case 3:pfirst->athlete[i].score = 3;break;

case 4:pfirst->athlete[i].score = 2;break;

case 5:pfirst->athlete[i].score = 1;break;

}}

if ( pfirst->athlete[i].item <=msp )

{pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;

}else

{pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;

}}

pfirst->totalscore = pfirst->menscore + pfirst->womenscore;

pfirst = pfirst->next;

}}

output()

{pfirst = head->next;

psecond = head->next;

while ( pfirst->next != NULL )

{clrscr();

printf("\n第%d号学校的结果成绩:",pfirst->serial);

printf("\n\n项目的数目\t学校的名字\t分数");

for (i=1;i<=ntsp;i++)

{for (j=1;j<=pfirst->count;j++)

{if ( pfirst->athlete[j].item == i )

{printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;

}}

}printf("\n\n\n\t\t\t\t\t\t按任意建 进入下一页");

getch();

pfirst = pfirst->next;

}clrscr();

printf("\n运动会结果:\n\n学校编号\t男运动员成绩\t女运动员成绩\t总分");

pfirst = head->next;

while ( pfirst->next != NULL )

{printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);

pfirst = pfirst->next;

}printf("\n\n\n\t\t\t\t\t\t\t按任意建结束");

getch();

}create()

{pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));

pfirst->next = head->next ;

head->next = pfirst ;

pfirst->count = 1;

pfirst->menscore = 0;

pfirst->womenscore = 0;

pfirst->totalscore = 0;

}void Save()

{FILE *fp;

if((fp = fopen("school.dat","wb"))==NULL)

{printf("can't open school.dat\n");

fclose(fp);

return;

}fwrite(pfirst,sizeof(SCH),10,fp);

fclose(fp);

printf("文件已经成功保存\n");

}main()

{system("cls");

printf("\n\t\t\t 运动会分数统计\n");

printf("输入学校数目 (x>= 5):");

scanf("%d",&nsc);

printf("输入男选手的项目(x<=20):");

scanf("%d",&msp);

printf("输入女选手项目(<=20):");

scanf("%d",&wsp);

ntsp = msp + wsp;

phead = calloc(ntsp,sizeof(int));

pafirst = phead;

pasecond = phead;

input();

calculate();

output();

Save();

}

懒得够可以的....

二级考试书里有很典型的民航定飘系统的题目,到图书管找去

英语中有哪些中学生需要掌握的介词固定搭配?

1 WITH (1)v+with (a) v+with begin, mix, agree, deal, fight, meet, play, quarrel, do, fool, reason, correspond, comply, settle, (b) v + sth (sb) + with + sth (sb) compare, provide, supply, feed, replace, combine, equip, furnish, (2)adj+with angry, strict, pleased, busy, covered, satisfied, filled, wrong, wild, crowded, connected, popular, covered, patient, annoyed, acquainted, delighted, confronted, content, friendly, identical, frank, concerned, bored, afflicted, associated, blended, burdened, comparable, consistent, disappointed, displeased, endowed, enraged, exhausted, familiar, gifted, impatient, infested, intimate, irritated, level, moved, occupied, overcome, popular, satisfied, vexed (3) n+with acquaintance, alliance, trouble, talk, chat, connection, consultation, conversation, sympathy,

2 AT (1)v+at aim, point, snatch, wonder, strike, work, look, glance, laugh, run, catch, shoot, stare, glare, thrust, smile, call, fire, tear, knock, winder, arrive, come, gasp, (2)adj+at amused, delighted, angry, good, surprised, astonished, pleased, terrified, clever, alarmed, astonished, clumsy, disgusted, impatient, quick, startled, surprised, (3)n+at knock, pull, look, glance, smile, game, astonishment, surprise, alarm,

3 IN (1)v+in get, lie, turn, draw, believe, share, take, drop, give, call, hand, succeed, bring, result, trade, involve, check, count, cut, indulge, pour, participate, intervene, fill, join, confide, trust, believe, persist, consist, (b) V+sb(sth)+in help, spend (2)adj+in rich, interested, active, disappointed, engaged, busy, weak, expert, successful, absorbed, skilled, concerned, experienced, confident, employed, accurate, clothed, diligent, negligent, proficient, prompt, versed, (3)n+in interest, progress, satisfaction, faith, belief, confidence, response, pride, perseverance, harm, difficulty, pleasure, confidence, delight,

4 FROM (1)V+from (a) V + from learn, die, come, suffer, hear, fall, rise, hang, escape, date, depart, result, descend, refrain, abstain, differ, distinguish, derive, expel, conceal, judge (b) V + sth ( sb) +from + sth ( sb or a place) borrow, protect, receive, separate, keep, stop, prevent, deter, choose, remove, save, dissuade, excuse, restrain (2)adj+from different, far, tired, made, separate, absent, distinct, hidden, made, (3)n+from letter, visitor, absence, difference, protection, relief, rescue,

5 OF (1)V+of (a) V+of consist, dream, hear, tell, think, know, talk, die, speak (b) V+sb+of+sth rob, warn, inform, remind, accuse, cheat, convince, relieve, deprive, (c) V+sth+of+sb ask, beg, demand, require, (2)adj+of aware, careful, free, short, sure, certain, worthy, afraid, hopeful, proud, full, tired, made, capable, impatient, considerate, characteristic, guilty, capable, composed, jealous, ashamed, envious, ignorant, apprehensive, bare, cautious, clear, composed, conscious, descriptive, exclusive, forgetful, fond, hard, incapable, informed, innocent, made, mindful, neglectful, observant, possessed, productive, regardless, rid, sensible, sick, susceptible, weary (3) n+of quality, number, sample, choice, impression, neglect, attack, care, consideration, pleasure, doubt, way equivalence, possibility, example,

6 ON (1)v+on (a) v+on act, lean, live, work, depend, look, wait, turn, switch, pull, have, keep, call, put, push, speak, insist, push, collaborate, count, frown, reckon, speculate, figure, carry, (b) V+sb(sth)+ON+sb(sth) congratulate, spend, base, fix (2)adj+on hard, keen, dependent, based, impressed, (3)n+on book, discussion, lecture, advice, opinion, impression, attack, dependence, judgment, pity, mercy, authority

7 TO (1)v+to (a) v+to listen, stick, refer, turn, point, reply, occur, attend, see, lead, happen, come, get, write, hold, agree, belong, adapt, attribute, object, subscribe, adjust, accede, yield, resort, relate, respond, testify, succumb, (b) v+to+sb announce, describe, explain, express, mention, report, say, shout, suggest, whisper, speak, talk, nod, (c) v+sth(sb)+sth(sb) devote, compare, add, introduce, invite, leave, join, reduce, sentence, carry, take, (2)adj+to equal, opposed, true, familiar, close, near, kind, harmful, polite, rude, similar, useful, married, known, used, good, dedicated, fair, essential, parallel, related, sensible, relevant, possible, indifferent, devoted, comparable, necessary, contrary, suitable, strange, close, alike, opposite, familiar, inferior, superior, proportionate, accessory, accustomed, adapted, addicted, adequate, adjacent, afflicted, akin, alive, amenable, applicable, attentive, awake, blind, common, conductive, congenial, contiguous, contrary, corresponding, deaf, derogatory, disagreeable, displeasing, distasteful, exposed, false, fatal, grateful, hostile, important, indifferent, loyal, moved, obedient, odious, opposite, painful, partial, peculiar, pleasant, precious, preferable, precious, prior, profitable, prone, proper, relative, relevant, sacred, strange, subsequent, susceptible, thankful, troublesome, (3)n+to key, answer, visitor, end, way, solution, traitor, attention, exception, gratitude, approach

8 FOR (1)v+for (a)v+for account, beg, hope, send, look, ask, long, pay, wish, wait, leave, fight, plan, prepare, care, stand, search, answer, run, call, bargain, inquire, press, apply, provide, apologize, grieve (b)v+sb+for+sth ask, blame, forgive, pardon, pay, praise, punish, reward, thank, excuse, (2)adj+for eager, bad, good, famous, fit, suitable, ready, sorry, grateful, useful, late, responsible, proper, crucial, competent, eligible, noted, renowned, appropriate, notorious, convenient, possible, profitable, liable, necessary, anxious, bound, eligible, impatient, liable, sufficient, uncared, unfit, zealous, (3)n+for plan, need, reason, explanation, ability, affection, excuse, ambition, anxiety, reputation, consideration, necessity, talent, sympathy, cause, pretext, qualification

9 ABOUT (1)v+about quarrel, agree, consult, complain, speak, bring, think, set, care, fumble, fuss, leave, move, lie, hear, speculate, inquire, (2)adj+about happy, anxious, nervous, cautious, careful, certain, excited, particular, pleased, concerned, enthusiastic, uneasy, troubled (3)n+on concern, anxiety, opinion, question

enjoy doing sth

on the farm,in the playground,on the ground

C语言课程设计~~~ 要求编写一段程序,题目是《校际运动会管理系统》

课程设计任务书

一、题目:

十佳运动员评选活动。

二、 系统设计要求

1.充分理解课程设计的目的和意义

有一个寓言叫庖丁解牛,讲的是一个叫庖丁的人,在开始学宰牛时,因为不了解牛的身体构造,眼前所见无非就是一头头庞大的牛。等他有了三年的宰牛经历后,就完全了解了牛的构造。再看牛时,出现在眼前的就不再是一头整牛,而是许多可以拆卸下来的零部件!

编成也是一样的,在没深入学习之前,总觉得别人的程序写得好,自己编又总觉得无从下手。所谓胸有成竹,意在笔先,我们认为可以通过读程序来培养“意”念。在进行本课程设计时,希望能够首先学会对程序的功能进行解构,因为如果不了解程序的需求就贸然下手,见到的必然是一条庞大的“牛”。在此基础上,如果能够进一步掌握编程的逻辑思维方式,注意结构化的程序设计、数据结构的选择、算法的实现……看到的将不再是一条条语句,而是一个个函数和功能模块了。当然要像庖丁一样,不用眼睛看,烂熟于心,还需要在长期的学习中反复实践、观察、分析、比较、总结,逐渐地积累和提高。

2. 功能要求

某市体委与电视台联合举办十佳运动员有奖评选活动,具体说明如下:

(1)体委组织有关人士评出了如表1所示的20个候选人名单。

运动员编号 运动员姓名 运动员编号 运动员姓名

01 小明 … …

02 小翔 20 小丹

(2)电视台在网上设立了投票站供市民投票,以便用计算机进行统计和核对。选票格式如表2所示。

选票编号 0000001

投票人姓名 投票人地址

拟选运动员编号

选票号为7位数字,有效的运动员编号是01~20。

(3)计算机统计的具体任务是:

① 统计出各候选人的得票数,并根据得票数排定名次,选出十佳人员。

② 根据命中率选出10个获奖的参选者,并排定名次。

命中率=命中分+次序分

命中分:选中十佳中的一个即得10分,选中n个得n╳10分(不考虑次序)。

次序分:选票中的第一个运动员与十佳中的第一名相符(简称选中第一名)得9分,选中第二名得8分,……,选中第十名的0分。

(4)编写出完成以上统计任务的程序。

具体要求如下:

① 候选人数据和选票数据应以文本文件的方式分别存放在两个文件中,选票中参选人的地址可以不考虑。

② 程序中,对选票数据要求采用结构体作数据结构。

③ 程序除能完成统计功能外,应具有核对选票数据的功能,并且每一功能的实现要采用选择菜单的方式进行(使用简单的文本菜单),菜单至少包含以下几项:

a. 统计

b. 核对选票

c. 退出

④ 程序和数据中不提倡使用汉字,相应的地方用英文代替。

⑤ 各大功能和各个相对独立的任务要求编写成独立的函数,主函数只用于管理菜单和组织调用个功能函数。

⑥ 统计结果除在屏幕显示外,还要求输出到文件中。

三、要求

1. 设计任务在2009年6月22日——2009年7月3日二周内完成。

2. 设计成果包括《十佳运动员评选》源代码一份,设计报告一份。

3. 设计成果必须于2009年7月3日前上交。

四、设计报告编写提纲

1. 设计的内容介绍;

2. 设计的相关专业知识、技术说明;

3. 完成的步骤和实现效果;

4. 关键代码及注释;

5. 设计总结。

五、设计成绩评定依据

1. 完成效果50%;

2. 设计报告35%;

3. 考勤15%;

六、时间安排

第一阶段(2009.6.22—2009.6.24):收集资料、查阅参考书,相关知识准备;

第二阶段(2009.6.25—2009.7.1):上机实现

第三阶段(2009.7.1—2009.7.3):集成功能测试,完成上交材料

七、参考文献

《C语言程序设计》 中国铁道出版社

网络资源

八、时间安排

教师指导时间 时段 地点

18周6月23日 星期二 8:00-11:50;2:00-4:00 二机房

18周6月24日 星期三 8:00-11:50 二机房

19周6月30日 星期二 8:00-11:50;2:00-4:00 二机房

19周7月2日 星期四 8:00-11:50 二机房

设定姓名长度不超过20字符。每个项目结束时,将其编号、类型符(区分取前3名还是前5名)输入,并按名次顺序输入运动员姓名、学校和成绩。程序已做改动,增加了一些代码以提高程序的健壮性。

本题完整的c程序如下,在win-tc和Dev-c++下调试通过,运行正确。

#include

#include

#include

#include

#define n 5 /*设定,可更改*/

#define m 3 /*设定,可更改*/

#define w 2 /*设定,可更改*/

struct achievement /* 定义表示成绩的结构体 */

{int schoolnumber;/* 学校编号 */

char name[20]; /* 姓名 */

int mark; /* 分数 */

int result;};

struct pro /* 表示项目的结构体 */

{int tag;/* 项目编号 */

struct achievement ach[m+w];

int number;

};

struct Node

{struct pro date;

struct Node *next;

};

main()

{int i,j,t;

int x[n]={0};int y[n]={0}; /* x[n]和y[n]分别表示男子和女子团体总分 */

struct Node *head;

struct Node *p;

struct Node *q;

if((head=(struct Node*)malloc(sizeof(struct Node)))==NULL) exit(1);

head->next=NULL; /* 初始化单链表 */

p=head;

for(i=0;i

{j=i+1;

printf("请输入第%d个项目的信息\n",j);

p->date.number=j;

printf("所取的名次数为:");

scanf("%d",&p->date.tag);

while(p->date.tag!=3&&p->date.tag!=5)

{ printf("输入有误,请重新输入!");

getchar(); /*加入此函数清空输入缓冲区,避免输入错误时程序进入无限循环*/

getchar();

printf("所取的名次数为:");

scanf("%d",&p->date.tag);

}t=1;

while(t<=p->date.tag)

{printf("第%d名的名字:",t);

scanf("%s",p->date.ach[t-1].name);

printf("第%d名的学校:",t);

scanf("%d",&p->date.ach[t-1].schoolnumber);

printf("第%d名的分数:",t);

scanf("%d",&p->date.ach[t-1].mark);

p->date.ach[t-1].result=t;

t++;

}if(j!=m+w)/* 注意这里 */

{q=(struct Node*)malloc(sizeof(struct Node)); /* 生成新结点 */

p->next=q;

p=q;

p->next=NULL;

}}

for(i=0;i

{j=i+1;

printf("\n学校%d成绩单:\n",j);

p=head;

while(p!=NULL)

{t=1;

while(t<=p->date.tag)

{if(p->date.ach[t-1].schoolnumber==j)

{printf("获奖项目:%d ",p->date.number);

printf("名次:%d ",p->date.ach[t-1].result);

printf("获奖人姓名:%s ",p->date.ach[t-1].name);

printf("所得分数:%d \n",p->date.ach[t-1].mark);

if(p->date.number<=m)

x[i]=x[i]+p->date.ach[t-1].mark;

else

y[i]=y[i]+p->date.ach[t-1].mark;

}t++;

}p=p->next;

}printf("\n男子团体总分:%d ",x[i]);

printf("女子团体总分:%d \n",y[i]);

printf("团体总分:%d\n",x[i]+y[i]);

}for(i=0;i

{p=head->next;

free(head);

head=p;

}getch();

}