#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
#include<string>
#include<vector>
#include<deque>
#include<ctime>
#include<algorithm>
#include <iomanip>
#include<stdlib.h>
#include<stdio.h>
#include<map>
enum{ONE,TWO,THREE};
/*
5名新员工 指派部门工作
员工信息 有姓名 年龄 电话 工资
通过multimap进行插入信息保存 显示
分部门显示员工信息 显示全部员工信息
*/
class Worker
{
public:
Worker(string name,int money){
this->m_Name = name;
this->m_Money = money;
}
string m_Name;
int m_Money;
};
void createWorker(vector<Worker> &v)
{
string nameseed = "ABCDE";
for (int i = 0; i < 5; i++)
{
string name = "员工";
name += nameseed[i];
int money = rand() %3001 +2000;
Worker w(name,money);
v.push_back(w);
}
}
void printWk( vector<Worker> &v)
{
for (vector<Worker>::iterator it = v.begin(); it != v.end(); it&#
c++ STL 练习
最新推荐文章于 2023-12-17 22:47:13 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)