当前位置:网站首页>Exercise: store department information
Exercise: store department information
2022-07-29 07:56:00 【A tong Muyou】
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
class Employee
{
private:
int id;
string name;
public:
Employee(int i, string n)
{
id = i;
name = n;
}
void show()
{
cout << " Job number : " << id << " full name : " << name << endl;
}
};
int main(void)
{
Employee e1(10, "aa");
Employee e2(11, "ab");
Employee e3(12, "ac");
Employee e4(13, "ad");
Employee e5(14, "af");
Employee e6(15, "ag");
Employee e7(16, "ah");
Employee e8(17, "aj");
multimap<string, Employee> m;
//
m.emplace("salse", e1);
m.emplace("salse", e2);
//
m.insert(make_pair("delpment", e3));
m.insert(make_pair("delpment", e4));
//
m.emplace(pair<string, Employee>("fans", e5));
m.emplace(pair<string, Employee>("fans", e6));
m.emplace(pair<string, Employee>("fans", e7));
m.emplace(pair<string, Employee>("fans", e8));
for(auto &l : m)
{
cout << " department :" << l.first << " ";
l.second.show();
}
return 0;
}#include <iostream>
#include <stack>
#include <queue>
using namespace std;
int main(void)
{
stack<int> s;
for(int i=0; i<10; i++)
{
s.push(i);
}
cout << s.top() << endl;
cout << s.size() << endl;
cout << "________________" << endl;
while(!s.empty())
{
cout << s.top() << endl;
s.pop();
}
cout << "________________" << endl;
queue<int> q;
for(int i=0; i<10; i++)
{
q.push(i);
}
cout << q.front() << endl;
cout << q.back() << endl;
cout << q.size() << endl;
cout << "________________" << endl;
while(!q.empty())
{
cout << q.front() << endl;
q.pop();
}
cout << "________________" << endl;
priority_queue<int,deque<int>,less<int>> p;
for(int i=0; i<10; i++)
{
p.emplace(i);
}
cout << p.top() << endl;
cout << p.size() << endl;
cout << "________________" << endl;
while(!p.empty())
{
cout << p.top() << endl;
p.pop();
}
cout << "________________" << endl;
}
边栏推荐
- Blue Bridge Cup group a selection XOR
- 【无标题】格式保存
- Useful websites
- [skill accumulation] common expressions when writing emails
- 在一个sql文件中,上面定义一个测试表及数据,下面可以select* from 测试表
- Dynamic Thresholds Buffer Management in a Shared Buffer Packet Switch论文总结
- Amaze UI 图标查询
- Data warehouse modeling, what is wide table? How to design? Advantages and disadvantages
- Jianmu continuous integration platform v2.5.2 release
- 207. Curriculum
猜你喜欢
![[experience] relevant configuration of remote connection to intranet server through springboard machine](/img/27/25301cce8a4e5fa0c91902c7b734fb.png)
[experience] relevant configuration of remote connection to intranet server through springboard machine

佳木斯市场监管局开展防疫防虫害专题食品安全网络培训

Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇

Cs61abc sharing session (VI) detailed explanation of program input and output - standard input and output, file, device, EOF, command line parameters

【深度学习】数据准备-pytorch自定义图像分割类数据集加载

NLP introduction + practice: Chapter 5: using the API in pytorch to realize linear regression

技术分享| 快对讲综合调度系统

Go, how to become a gopher, and find work related to go language in 7 days, Part 1

CentOS deploy PostgreSQL 13
![[paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching](/img/dc/255bf122d5243f2a08ca0e03b53137.png)
[paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching
随机推荐
Phased learning about the entry-level application of SQL Server statements - necessary for job hunting (I)
MySQL 45 | 08 is the transaction isolated or not?
Jump from mapper interface to mapping file XML in idea
After the access database introduces DataGridView data, an error is displayed
207. Curriculum
Data unit: bit, byte, word, word length
Space shooting Lesson 17: game over (end)
Dilworth theorem
Actual measurement of boot and pH pins of buck circuit
[introduction to cryoelectron microscopy] Caltech open class course notes part 3:image formation
Cs61abc sharing session (VI) detailed explanation of program input and output - standard input and output, file, device, EOF, command line parameters
330. Complete the array as required
How to draw an excellent architecture diagram
Limitations of push down analysis
Excellent urban design ~ good! Design # visualization radio station will be broadcast soon
webapi接口文件下载时跨域问题
Prepare esp32 environment
flutter只要是数据,都会判空的
Go, how to become a gopher, and find work related to go language in 7 days, Part 1
输出1234无重复的三位数