资源简介
c++实现的运动会计分系统。。。。。
(1)可以输入各个项目的前三名或前五名的成绩;
(2)能统计各系总分;
(3)可以按系编号、系总分、男女团体总分排序输出;
(4)可以按系编号查询学校某个项目的情况;可以按项目编号查询取得前三或前五名的系。

代码片段和文件信息
//copyright to ZhangLei
#include
using namespace std;
#include
#include
#define si 15 //项目总数
#define man 10 //男子项目数
#define woman 5 //女子项目数
ifstream fin(“a.txt“);
ofstream fout(“运动会.txt“);
//itemnum为运动会项目总数
int itemnum=0; //输入的项目总数
typedef struct item
{
item();
item(int tol);
int itemNum; //itemNum为项目编号
int * college; //college为系编号
string * stuname; //stuname为运动员姓名
int * StudentScore; //StudentScore为运动员成绩
item * NextItem;
int total; //total为项目登记的人数
}item*Node;
struct score
{
int point; //point为系总得分
int num; //num为系编号
int manpoint; //manpoint为男子总得分
int womanpoint; //womanpoint为女子总得分
void operator=(const score &original); //重载运算符
};
item::item( )
{
NextItem=NULL;
}
item::item(int tol)
{
college=new int[tol];
stuname=new string[tol];
StudentScore=new int[tol];
NextItem=NULL;
}
void score::operator =(const score &original)
{
//score new_score={0};
num=original.num;
manpoint=original.manpoint;
point=original.point;
womanpoint=original.womanpoint;
//return new_score;
}
Node lastitem;
//////////////输入各个项目的成绩/////////////////////////////////
bool input(Node &head)
{
fout<<“***************项目成绩输入*****************“< int i;
Node newitem;
int val=0;
fout<<“请输入项目人数“< fin>>val;
newitem=new item(val);
if(!newitem) return false;
fout<<“请输入该项目的编号:“;
fin>>newitem->itemNum;
fout< newitem->total=val;
for(i=0;i {
fout<<“请输入第“< fin>>newitem->stuname[i];
fout<<“请输入运动员系编号:“;
fin>>newitem->college[i];
fout<<“请输入运动员分数:“;
fin>>newitem->StudentScore[i];
fout< }
//若头节点为空,新节点做表头
if(head==NULL) {
head=newitem;
lastitem=head;
}
//否则加入表尾
else
{
lastitem->NextItem=newitem;
lastitem=newitem;
}
itemnum++;
fout<<“这个项目输入完毕!“< return true;
}
//////////////////////按项目编号查询某个项目前几名的系的情况//////////////////////////////////
bool ItemSort(Node headint ItemName)
{
fout<<“项目编号“<<“ “<<“名次 “<<“ 姓名 “<<“ 系 “<<“ 积分 “< Node p;
//若链表不为空,对链表进行搜索
if(itemnum!=0)
{
p=head;
int j=0;
for(int i=1;i<=itemnum;i++)
{
if(p->itemNum==ItemName)
{
j=1;
for(int m=1;mtotal+1;m++)
{
fout<stuname[m-1]
<<“ “<college[m-1]<<“ “
<StudentScore[m-1]< }
break;
}
else
p=p->NextItem;
}
if(j==0)
fout<<“没有此项目的相关信息“< fout<<“********************************************“< }
else
fout<<“还没有输入数据,请先进行输入操作!“< return true;
}
//////////////////////用户给出系编号,显示该系得分
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 204 2009-06-28 09:35 运动会计分系统\a.txt
文件 229 2009-06-28 11:37 运动会计分系统\b.txt
文件 295936 2009-06-28 11:37 运动会计分系统\Debug\sports meeting.bsc
文件 589925 2009-06-28 11:39 运动会计分系统\Debug\sports meeting.exe
文件 834576 2009-06-28 11:39 运动会计分系统\Debug\sports meeting.ilk
文件 392569 2009-06-28 11:39 运动会计分系统\Debug\sports meeting.obj
文件 1997944 2009-06-28 11:39 运动会计分系统\Debug\sports meeting.pch
文件 1156096 2009-06-28 11:39 运动会计分系统\Debug\sports meeting.pdb
文件 0 2009-06-28 11:37 运动会计分系统\Debug\sports meeting.sbr
文件 99328 2009-06-28 11:39 运动会计分系统\Debug\vc60.idb
文件 118784 2009-06-28 11:39 运动会计分系统\Debug\vc60.pdb
文件 10317 2009-06-28 11:39 运动会计分系统\sports meeting.cpp
文件 3499 2009-06-28 11:39 运动会计分系统\sports meeting.dsp
文件 553 2009-06-28 11:39 运动会计分系统\sports meeting.dsw
文件 50176 2009-06-28 11:39 运动会计分系统\sports meeting.ncb
文件 48640 2009-06-28 11:39 运动会计分系统\sports meeting.opt
文件 788 2009-06-28 11:39 运动会计分系统\sports meeting.plg
文件 325632 2009-06-28 11:38 运动会计分系统\运动会.doc
文件 6323 2009-06-28 11:39 运动会计分系统\运动会.txt
目录 0 2009-06-28 11:40 运动会计分系统\Debug
目录 0 2009-07-14 13:56 运动会计分系统
----------- --------- ---------- ----- ----
5931519 21
- 上一篇:汉诺塔移动动画 C++
- 下一篇:基于c++MFC的运动会管理系统.rar
相关资源
- C语言课程设计
- 利用C++哈希表的方法实现电话号码查
- c语言电子商务系统
- 学校超市选址问题(数据结构C语言版
- 数据结构,迷宫问题C语言版源代码
- DSDEMO-C演示(数据结构C语言版 严蔚敏
- 数据结构 图的遍历源代码
- 数据结构实验源代码集
- 实验报告:数据结构长整数四则运算
- 宠物管理系统课程设计(源码+数据库
- 数据结构教程李春葆第五版书中例题
- c语言课程设计:客房登记系统源码
- 吕鑫vc6c++数据结构视频源码
- 数据结构教程李春葆第五版课后答案
- 李春葆课后习题答案(数据结构教材
- 8位竞赛抢答器的课程设计报告.docx
- 数据结构1800题 题+答案(全)
- 数据结构(C语言版)ppt课件,清华,
- c++常用游戏算法及数据结构设计
- 数据结构超全面复习导图
- VC++MFC课程设计的学生成绩管理系统
- 《Data Structures and Algorithm Analysis in C
- 数据结构C语言版教学笔记严蔚敏
- C++实现21点游戏
- c++课程设计学生管理系统浙工大源码
- 数据结构C语言版期末考试试题(有答
- 多功能计算器实现C++代码以及代码详
- C语言数据结构银行客户排队
- C语言实现栈操作
- 课程设计: MFC 学生信息管理系统
评论
共有 条评论