校园信息管理系统之容器法

时间:2012-05-31 04:10:02
【文件属性】:

文件名称:校园信息管理系统之容器法

文件大小:146KB

文件格式:RAR

更新时间:2012-05-31 04:10:02

校园信息管理系统之容器法

#include #include #include "head.h" //--------------------------------------- long Student::returnsort(){return id;} void Student::show() { cout<<"*************************"<>id; cout<<"姓名:"<>name; cout<<"性别:"<>sex; cout<<"家庭地址:"<>address; cout<<"出生日期:"<>date.year; cout<<"月:"<>date.month; cout<<"日:"<>date.day; cout<<"所在班级:"<>sclass; cout<<"所学专业"<>major; cout<<"所学课程"<>courses; cout<<"入学日期:"<>sregister.year; cout<<"月:";cin>>sregister.month; cout<<"日";cin>>sregister.day; } void Student::load() { Student stud; ifstream infile("student.txt",ios::in|ios::binary); if(!infile) { cerr<<"open error!"<> (istream& input,Student& c)//运算符">>"重载为友元函数 { cout<<"编号:"<>c.id; cout<>c.name; cout<>c.sex; cout<>c.address; cout<>c.date.year; cout<<"月:";input>>c.date.month; cout<<"日:";input>>c.date.day; cout<>c.sregister.year; cout<<"月:";input>>c.sregister.month; cout<<"日:";input>>c.sregister.day; cout<>c.sclass; cout<>c.major; cout<>c.courses; cout<(Student& c1,Student& c2)//重载运算符">" { if(c1.id>c2.id) return true; else return false; } bool operator ==(Student &c1,Student &c2)//重载运算符"==" { if(c1.id==c2.id) return true; else return false; } //-------------------------------------- long Teacher::returnsort(){return id;} void Teacher::show() { cout<<"编号:"<>id; cout<<"姓名:"<>name; cout<<"性别:"<>sex; cout<<"家庭地址:"<>address; cout<<"出生日期:"<>date.year; cout<<"月:";cin>>date.month; cout<<"日:";cin>>date.day; cout<<"所教课程:"<>courses; cout<<"到校日期:"<>tregister.year; cout<<"月:";cin>>tregister.month; cout<<"日";cin>>tregister.day; } void Teacher::load() { Teacher teac; ifstream infile("teacher.txt",ios::in|ios::binary); if(!infile) { cerr<<"open error!"<> (istream &input,Teacher &c)//运算符">>"重载为友元函数 { cout<<"编号:"<>c.id; cout<>c.name; cout<>c.sex; cout<>c.address; cout<>c.date.year; cout<<"月:";input>>c.date.month; cout<<"日:";input>>c.date.day; cout<>c.tregister.year; cout<<"月:";input>>c.tregister.month; cout<<"日:";input>>c.tregister.day; cout<>c.courses; cout<(Teacher &c1,Teacher &c2)//重载运算符">" { if(c1.id>c2.id) return true; else return false; } bool operator ==(Teacher &c1,Teacher &c2)//重载运算符"==" { if(c1.id==c2.id) return true; else return false; }


【文件预览】:
校园信息管理系统之容器法
----main.cpp(12KB)
----head.h(2KB)
----head.o(21KB)
----student.txt(1KB)
----校园信~1.exe(542KB)
----校园信息管理系统.dev(1KB)
----main.o(103KB)
----teacher.txt(1KB)
----head.cpp(6KB)
----Makefile.win(959B)

网友评论