#include<string>
#include<iostream>
#include<list>
using namespace std;
//实现一个自己的输入输出流,改装相应的功能
class IO_Stream
{
public:
template<typename T>
IO_Stream& operator<<(T& obj)
{
cout<<obj;
return *this;
}
template<typename T>
IO_Stream& operator>>(T& obj)
{
cin>>obj;
return *this;
}
};
//特化
template<>
IO_Stream& IO_Stream::operator>>(float& obj)
{
while(!(cin>>obj))
{
cout<<"输入不合法,请重新输入:";
cin.clear();
while(cin.get()!='\n');
}
return *this;
}
template<>
IO_Stream& IO_Stream::operator>>(size_t& obj)
{
while(!(cin>>obj))
{
cout<<"输入不合法,请重新输入:";
cin.clear();
while(cin.get()!='\n');
}
return *this;
}
template<>
IO_Stream& IO_Stream::operator>>(string& obj)
{
if(!cin.peek()) cin.get();
getline(cin,obj);
return *this;
}
//换行
const IO_Stream& ed(const IO_Stream& u)
{
cout<<endl;
return u;
}
IO_Stream io;
//------------------------------------------
//考生类
class Student
{
private:
public:
string name; //名字
string exam_number; //考生号
string graduate_school; //毕业学校
float total_score = 0; //高考总分
string address; //住址
string phone_number; //电话号码
};
//专业类
class Major
{
private:
public:
string recruit_code; //招生代码
string major_name; //专业名
string subject; //所属学科
string institution; //所属院校
size_t plan_population = 0; //计划人数
};
//志愿填报
class College_Application
{
private:
public:
Student* student; //考生
Major* majors; //专业数组
size_t majors_num = 0; //专业数量
string major_adjustment; //调剂说明
string note; //备注
};
//志愿填报系统
class CS_System
{
private:
list<Student> students;
list<Major> majors;
list<College_Application> applications;
public:
};
int main()
{
int a,b;
io<<"haha"<<"nono"<<ed;
}
#include<iostream>
#include<list>
using namespace std;
//实现一个自己的输入输出流,改装相应的功能
class IO_Stream
{
public:
template<typename T>
IO_Stream& operator<<(T& obj)
{
cout<<obj;
return *this;
}
template<typename T>
IO_Stream& operator>>(T& obj)
{
cin>>obj;
return *this;
}
};
//特化
template<>
IO_Stream& IO_Stream::operator>>(float& obj)
{
while(!(cin>>obj))
{
cout<<"输入不合法,请重新输入:";
cin.clear();
while(cin.get()!='\n');
}
return *this;
}
template<>
IO_Stream& IO_Stream::operator>>(size_t& obj)
{
while(!(cin>>obj))
{
cout<<"输入不合法,请重新输入:";
cin.clear();
while(cin.get()!='\n');
}
return *this;
}
template<>
IO_Stream& IO_Stream::operator>>(string& obj)
{
if(!cin.peek()) cin.get();
getline(cin,obj);
return *this;
}
//换行
const IO_Stream& ed(const IO_Stream& u)
{
cout<<endl;
return u;
}
IO_Stream io;
//------------------------------------------
//考生类
class Student
{
private:
public:
string name; //名字
string exam_number; //考生号
string graduate_school; //毕业学校
float total_score = 0; //高考总分
string address; //住址
string phone_number; //电话号码
};
//专业类
class Major
{
private:
public:
string recruit_code; //招生代码
string major_name; //专业名
string subject; //所属学科
string institution; //所属院校
size_t plan_population = 0; //计划人数
};
//志愿填报
class College_Application
{
private:
public:
Student* student; //考生
Major* majors; //专业数组
size_t majors_num = 0; //专业数量
string major_adjustment; //调剂说明
string note; //备注
};
//志愿填报系统
class CS_System
{
private:
list<Student> students;
list<Major> majors;
list<College_Application> applications;
public:
};
int main()
{
int a,b;
io<<"haha"<<"nono"<<ed;
}