1.1map

 

The use of unordered_map and map are almost the same, except that the header files and definitions are different.

#include<iostream>
#include<map>//使用map需要的头文件 
#include<unordered_map>//使用unordered_map需要的头文件 
#include<set>//使用set需要的头文件 
#include<unordered_set>//使用unordered_set需要的头文件 
using namespace std;
int main(){
	map<int,int> m1;
	unordered_map<int,int> m2;

	set<int> s1;
	unordered_set<int> s2;
}

Supongo que te gusta

Origin blog.csdn.net/m0_73553411/article/details/135330783
Recomendado
Clasificación