#include <iostream>
#include <string>
#include "member_message.h"
using namespace std;
void cub::insert_cub() {
int staue;
while (1) {
cub_Lmess Node= new cub_mess;
cout << "社团基础信息的录入" << endl;
cout << "名称:"; cin >> Node->cub_name;
cout << "口号:"; cin >> Node->cub_slogan;
cout << "宗旨:"; cin >> Node->cub_aim;
cout << "章程:"; cin >> Node->cub_constitution;
cout << "发起人:"; cin >> Node->cub_principal;
cout << "性质:"; cin >> Node->cub_property;
cout << "社长:"; cin >> Node->cub_proprieter;
cout << "副社长:"; cin >> Node->cub_past_proprieter;
cout << "联络员:"; cin >> Node->cub_group_leader;
Node->max_num = 1000;
cub_list.push_back(Node);
cout << "\n是否继续输入(否:0,其他操作均为继续输入):"; cin >> staue;
if (staue == 0) break;
else cout << endl;
}
}
void cub::insert_cub_mem(member& m1) {
int staue;
cub_Lmem Node;
mem_Lbasic Node1;
string s1;
list<cub_Lmess>::iterator pos;
while (1) {
cout << "请输入要添加成员的社团名称:";
cin >> s1;
for (pos = cub_list.begin(); pos != cub_list.end(); ++pos)
if ((*pos)->cub_name == s1) break;
if (pos == cub_list.end()) {
cout << "不存在该社团,请确认输入信息准确无误!";
}
else {
if ((*pos)->cub_mem_list.size() == (*pos)->max_num) {
cout << "社团人数已达到最大容量,请登录管理员账号进行修改";
return;
}
cout << "请输入加入成员的学号:";
cin >> s1;
if (m1.find_bool(s1)) {
Node = new cub_mem;
m1.assign_cub(Node, s1);
cout << "信息库中已拥有该成员信息,系统将自动录入成员信息";
}
else {
cout << "信息库中无该成员信息,请手动录入成员信息\n";
Node = new cub_mem;
Node1 = new mem_basic;
cout << "社团成员信息的录入" << endl;
cout << "学号:"; cin >> Node->id_number;
cout << "姓名:"; cin >> Node->name;
cout << "性别:"; cin >> Node->sex;
cout << "班级:"; cin >> Node->grade;
Node->integral = 10;
Node->rank_title = "学民";
Node1->id_number = Node->id_number;
Node1->name = Node->name;
Node1->sex = Node->sex;
Node1->grade = Node->grade;
Node1->integral = Node->integral;
Node1->rank_title = Node->rank_title;
Node1->phone_num = "0"; Node1->time = "0";
m1.insert_cub_mem(Node1);
}
(*pos)->cub_mem_list.push_back(Node);
}
cout << "\n是否继续输入(否:0,其他操作均为继续输入):"; cin >> staue;
if (staue == 0) break;
else cout << endl;
}
}
void cub::delete_cub() {
if (cub_list.size() == 0) {
cout << "目前数据为空,不能进行删除操作!";
return;
}
int staue_exit; /*标志退出状态*/
string s1; /*录入数据*/
list<cub_Lmess>::iterator pos;
while (1) {
cout << "目前提供根据社团名称删除的方式";
cout << "请输入数据:";
cin >> s1;
for (pos =cub_list.begin(); pos != cub_list.end(); ++pos) {
if ((*pos)->cub_name == s1)
break;
}
if (pos == cub_list.end())
cout << "\n没有该社团信息,请核实填入信息无误!";
else cub_list.erase(pos);
cout << "\n是否继续删除(否:0,其他操作均为继续删除):"; cin >> staue_exit;
if (staue_exit == 0) break;
else cout << endl;
}
}
void cub::delete_cub_mem() {
if (cub_list.size() == 0) {
cout << "目前数据为空,不能进行删除操作!";
return;
}
int staue_del; /*标志输入状态*/
int staue_exit; /*标志退出状态*/
string s1; /*录入数据*/
list<cub_Lmess>::iterator pos;
list<cub_Lmem>::iterator pos1;
while (1) {
cout << "请输入所要删除成员的社团名称:";
cin >> s1;
for (pos = cub_list.begin(); pos != cub_list.end(); ++pos) {
if ((*pos)->cub_name == s1)
break;
}
if (pos == cub_list.end())
cout << "\n没有该社团信息,请核实填入信息无误!";
else {
cout << "目前提供两种删除方式(学号:1;姓名:2):"; cin >> staue_del;
cout << "\n请输入数据:"; cin >> s1;
if (staue_del == 1) {
for (pos1 = (*pos)->cub_mem_list.begin(); pos1 != (*pos)->cub_mem_list.end();
++pos1)
if ((*pos1)->id_number == s1)
break;
}
if (staue_del == 2) {
for (pos1 = (*pos)->cub_mem_list.begin(); pos1 != (*pos)->cub_mem_list.end();
++pos1)
if ((*pos1)->name == s1)
break;
}
if (pos1 == (*pos)->cub_mem_list.end())
cout << "\n没有该成员信息,请核实填入信息无误!";
else (*pos)->cub_mem_list.erase(pos1);
}
cout << "\n是否继续删除(否:0,其他操作均为继续删除):"; cin >> staue_exit;
if (staue_exit == 0) break;
else cout << endl;
}
}
void cub::preview_cub(cub_Lmess& m1) {
cout << "名称:" << m1->cub_name;
cout << "\t口号:" << m1->cub_slogan;
cout << "\t宗旨:" << m1->cub_aim << endl;
cout << "章程:" << m1->cub_constitution;
cout << "\t发起人:" << m1->cub_principal;
cout << "\t性质:" << m1->cub_property << endl;
cout << "社长:" << m1->cub_proprieter << ",副社长:"
<< m1->cub_past_proprieter << ",联络员:" << m1->cub_group_leader;
}
void cub::preview_cub_mem(cub_Lmem& m1) {
cout << "学号:" << m1->id_number;
cout << "\t姓名:" << m1->name;
cout << "\t性别:" << m1->sex << endl;
cout << "班级:" << m1->grade;
cout << "\t成员积分:" << m1->integral;
cout << "\t等级头衔:" << m1->rank_title << endl;
}
void cub::find_cub() {
if (cub_list.size() == 0) {
cout << "\n目前数据为空,不能进行查找操作!";
return;
}
int staue_exit; /*标志退出状态*/
string s1; /*录入数据*/
list<cub_Lmess>::iterator pos;
while (1) {
cout << "\n目前提供根据社团名称的查找方式";
cout << "\n请输入社团名称:"; cin >> s1;
for (pos = cub_list.begin(); pos != cub_list.end(); ++pos) {
if ((*pos)->cub_name == s1) {
cout << "\n社团信息为:";
preview_cub(*pos);
int k_staue;
list<cub_Lmem>::iterator pos1;
cout << "\n选择是否预览社团成员信息(是:1,其他一切操作均为不浏览)";
cin >> k_staue;
if (k_staue == 1) {
if ((*pos)->cub_mem_list.size() == 0)
cout << "\n该社团目前没有成员";
else
for (pos1 = (*pos)->cub_mem_list.begin(); pos1 != (*pos)->cub_mem_list.end();
++pos)
preview_cub_mem(*pos1);
}
break;
}
}
if (pos == cub_list.end())
cout << "\n没有该成员信息,请核实填入信息无误!";
cout << "\n是否继续查找(否:0,其他操作均为继续查找):"; cin >> staue_exit;
if (staue_exit == 0) break;
else cout << endl;
}
}
void cub::find_cub_mem() {
if (cub_list.size() == 0) {
cout << "目前数据为空,不能进行查找操作!";
return;
}
int staue_del; /*标志输入状态*/
int staue_exit; /*标志退出状态*/
string s1; /*录入数据*/
list<cub_Lmess>::iterator pos;
list<cub_Lmem>::iterator pos1;
while (1) {
cout << "请输入所要查找成员的社团名称:";
cin >> s1;
for (pos = cub_list.begin(); pos != cub_list.end(); ++pos) {
if ((*pos)->cub_name == s1)
break;
}
if (pos == cub_list.end())
cout << "\n没有该社团信息,请核实填入信息无误!";
else {
cout << "目前提供两种查找方式(学号:1;姓名:2):"; cin >> staue_del;
cout << "\n请输入数据:"; cin >> s1;
if (staue_del == 1) {
for (pos1 = (*pos)->cub_mem_list.begin(); pos1 != (*pos)->cub_mem_list.end();
++pos1)
if ((*pos1)->id_number == s1) {
break;
}
}
if (staue_del == 2) {
for (pos1 = (*pos)->cub_mem_list.begin(); pos1 != (*pos)->cub_mem_list.end();
++pos1)
if ((*pos1)->name == s1) {
break;
}
}
if (pos1 == (*pos)->cub_mem_list.end())
cout << "\n没有该成员信息,请核实填入信息无误!";
else preview_cub_mem(*pos1);
}
cout << "\n是否继续查找(否:0,其他操作均为继续查找):"; cin >> staue_exit;
if (staue_exit == 0) break;
else cout << endl;
}
}
void cub::alter_cub() {
if (cub_list.size() == 0) {
cout << "目前数据为空,不能进行查找操作!";
return;
}
int staue_exit; /*标志退出状态*/
string s1; /*录入数据*/
list<cub_Lmess>::iterator pos;
while (1) {
cout << "目前提供根据社团名称的查找方式";
没有合适的资源?快使用搜索试试~ 我知道了~
数据结构—高校社团助手源码(C++)
共35个文件
obj:7个
cpp:6个
tlog:6个
需积分: 19 11 下载量 26 浏览量
2017-08-01
16:51:56
上传
评论 1
收藏 13.28MB ZIP 举报
温馨提示
里含有成员数据管理、社团数据管理、活动及校园地图等基本内容。另含有自主设计的数据内部共享的算法等功能......
资源推荐
资源详情
资源评论
收起资源包目录
高校社团助手.zip (35个子文件)
高校社团助手
.vs
高校社团助手
v14
.suo 54KB
高校社团助手.VC.db 31.8MB
高校社团助手
高校社团助手.vcxproj.filters 2KB
message.h 66B
apdefine.cpp 4KB
mmdefine.cpp 7KB
member_message.h 5KB
file_dispose.h 76B
amdefine.cpp 11KB
sgdefine.cpp 6KB
main.cpp 7KB
cddefine.cpp 12KB
高校社团助手.vcxproj 8KB
Debug
sgdefine.obj 76KB
apdefine.obj 188KB
vc140.pdb 684KB
mmdefine.obj 432KB
高校社团助手.log 444B
main.obj 284KB
vc140.idb 1.03MB
addefine.obj 3KB
高校社团助手.Build.CppClean.log 2KB
amdefine.obj 479KB
cddefine.obj 482KB
高校社团助手.tlog
CL.write.1.tlog 11KB
CL.read.1.tlog 118KB
CL.command.1.tlog 6KB
link.write.1.tlog 1KB
link.command.1.tlog 2KB
link.read.1.tlog 4KB
高校社团助手.lastbuildstate 238B
Debug
高校社团助手.ilk 1.35MB
高校社团助手.pdb 2.44MB
高校社团助手.exe 265KB
高校社团助手.sln 1KB
共 35 条
- 1
资源评论
BoCong-Deng
- 粉丝: 1916
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功