c 中利用STL實現公司員工分組問題

2021-09-25 21:00:22 字數 1001 閱讀 1589

#includeusing namespace std;

#include#include#include#include/*

公司招聘了5個員工,5名員工進入公司之後,需要指派員工在那個部門工作

的人員資訊:姓名 年齡 ** 工資等組成

通過multimap進行資訊的插入 儲存 顯示

分部門顯示員工資訊,顯示全部的員工資訊

*/enum;

class worker

;void createworker(vector&v)

}void setgroup(vector&v,multimap&m)

}void showgroup(multimap&m)

//0 a b 1 c 2 d e

cout << "-----------------------------" << endl;

cout << "研發部門員工如下:" << endl;

pos = m.find(yanfa);

index = 0;

number = m.count(yanfa);

for (; pos != m.end(), indexsecond.m_name << "工資:" << pos->second.m_money << endl;

} cout << "-----------------------------" << endl;

cout << "美術部門員工如下:" << endl;

pos = m.find(meishu);

index = 0;

number = m.count(meishu);

for (; pos != m.end(), indexsecond.m_name << "工資:" << pos->second.m_money << endl; }}

int main()

*/ system("pause");

return 0;

}

c 中STL實現演講比賽流程

pragma once pragma warning disable 4996 include include include include include include include include using namespace std 1 某市舉行一場演講比賽,共有 24 個人參加,按參...

術 c 中利用反射實現深拷貝

c 中深拷貝不常用,但是需要的時候如果沒有,實在是麻煩的很。今天聊天,中梁大神說他實現了乙個,趕緊學習學習。廢話少說,直接上 using system using system.collections using system.collections.generic using system.ref...

C 之STL中sort函式的內部實現(一)

stl中提供了乙個sort 函式,用於排序。它的實現雖然是基於我們熟悉的quick sort,insertion sort,heap sort,但是內部卻龐大複雜。sort 函式只能接受randomaccessiterators,list slist都不能使用。stl中的sort 函式在資料量大的時...