1、题目:
公司招了10个人,随机分配3个部门,按组输出结果;
2、主要知识点:
vector容器 (sort的重写)
#include<iostream>
using namespace std;
#include<vector>
#include<string>
#include <algorithm>
#include <ctime>
class Worker {
public:
int m_salary;
string m_name;
int m_det;
Worker(int salary, string name, int det) {
this->m_salary = salary;
this->m_name = name;
this->m_det = det;
}
};
void createWorker(vector<Worker> & v) {
string numseed = "ABCDEFGHIJK";