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.
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
// ѧ<><D1A7><EFBFBD><EFBFBD>
|
|
|
|
|
class Student {
|
|
|
|
|
public:
|
|
|
|
|
std::string name;
|
|
|
|
|
int id;
|
|
|
|
|
std::string major;
|
|
|
|
|
int grade;
|
|
|
|
|
// <20><><EFBFBD>캯<EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
class Dormitory {
|
|
|
|
|
public:
|
|
|
|
|
int roomNumber;
|
|
|
|
|
int capacity;
|
|
|
|
|
std::string location;
|
|
|
|
|
std::vector<int> studentIds; // <20>洢ѧ<E6B4A2><D1A7>ID
|
|
|
|
|
// <20><><EFBFBD>캯<EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>
|
|
|
|
|
class DormitoryManagementSystem {
|
|
|
|
|
private:
|
|
|
|
|
std::vector<Student> students;
|
|
|
|
|
std::vector<Dormitory> dormitories;
|
|
|
|
|
|
|
|
|
|
void loadFromFiles() {
|
|
|
|
|
// <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void saveToFiles() {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1>浽<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DormitoryManagementSystem() {
|
|
|
|
|
loadFromFiles();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~DormitoryManagementSystem() {
|
|
|
|
|
saveToFiles();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addStudent(const Student& student) {
|
|
|
|
|
students.push_back(student);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addDormitory(const Dormitory& dormitory) {
|
|
|
|
|
dormitories.push_back(dormitory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void assignDormitory(int studentId, int dormitoryRoomNumber) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
DormitoryManagementSystem system;
|
|
|
|
|
// ʵ<><CAB5><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|