From 28a4865f7f4efef58540e6db80a8ae60490222b3 Mon Sep 17 00:00:00 2001 From: pofu6wkq7 <3340886557@qq.com> Date: Thu, 30 Nov 2023 22:14:16 +0800 Subject: [PATCH] ADD file via upload --- 宿舍管理系统.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 宿舍管理系统.cpp diff --git a/宿舍管理系统.cpp b/宿舍管理系统.cpp new file mode 100644 index 0000000..bf2f3ca --- /dev/null +++ b/宿舍管理系统.cpp @@ -0,0 +1,69 @@ +#include +#include +#include +#include + +// ѧ +class Student { +public: + std::string name; + int id; + std::string major; + int grade; + // 캯 +}; + +// +class Dormitory { +public: + int roomNumber; + int capacity; + std::string location; + std::vector studentIds; // 洢ѧID + // 캯 +}; + +// ϵͳ +class DormitoryManagementSystem { +private: + std::vector students; + std::vector dormitories; + + void loadFromFiles() { + // ļ + } + + void saveToFiles() { + // ݱ浽ļ + } + +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) { + // ѧ + } + + // ... +}; + +int main() { + DormitoryManagementSystem system; + // ʵû߼ + return 0; +} +