You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
757 B
44 lines
757 B
#include <iostream>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
// 学生类
|
|
class Student {
|
|
public:
|
|
std::string name;
|
|
int id;
|
|
// 构造函数等
|
|
};
|
|
|
|
// 宿舍类
|
|
class Dormitory {
|
|
public:
|
|
int roomNumber;
|
|
std::vector<Student> students;
|
|
// 构造函数等
|
|
};
|
|
|
|
// 宿舍管理系统类
|
|
class DormitoryManagementSystem {
|
|
private:
|
|
std::vector<Student> students;
|
|
std::vector<Dormitory> dormitories;
|
|
|
|
public:
|
|
void addStudent(const Student& student) {
|
|
students.push_back(student);
|
|
}
|
|
|
|
void addDormitory(const Dormitory& dormitory) {
|
|
dormitories.push_back(dormitory);
|
|
}
|
|
|
|
// 其他管理功能...
|
|
};
|
|
|
|
int main() {
|
|
DormitoryManagementSystem system;
|
|
// 添加学生、宿舍等
|
|
return 0;
|
|
}
|