#include<iostream>
#include<cstdio>
#include<unordered_map>
#include<bitset>
using namespace std;
int main(){
//测试unordered_map(哈希表)
unordered_map<char,bool> maps;
string S="ABCDEFHIJKL";
//测试特别好用的for循环
for(char& e:S){
maps[e]=false;
}
maps['G']=true;
S="ABCDEFGHIJKL";
cout<<(maps['A']==true)<<endl;
//测试bitset
bitset<8> a;
a=63;
cout<<a<<endl;
return 0;
}
【C++新特性尝鲜之】unordered_map bitset 特殊for循环
最新推荐文章于 2023-11-22 23:26:59 发布