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.
dormitory_management/宿舍管理系统.cpp

44 lines
757 B

#include <iostream>
#include <vector>
#include <string>
// ѧ<><D1A7><EFBFBD><EFBFBD>
class Student {
public:
std::string name;
int id;
// <20><><EFBFBD><EFBFBD><ECBAAF><EFBFBD><EFBFBD>
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class Dormitory {
public:
int roomNumber;
std::vector<Student> students;
// <20><><EFBFBD><EFBFBD><ECBAAF><EFBFBD><EFBFBD>
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>
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);
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
};
int main() {
DormitoryManagementSystem system;
// <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return 0;
}