//http://blog.youkuaiyun.com/chaiwenjun000/article/details/71154235
#include<iostream>
#include<cstdio>
#include<bitset>
using namespace std;
bitset<10> a;
bitset<10> b;
int main()
{
a.set();
cout<<a<<endl;
a.reset();
a[1]=1;
a=a|b;
cout<<a<<endl;
a.flip();
cout<<a;
}
bitset
最新推荐文章于 2025-11-10 11:04:47 发布
本文通过一个简单的C++程序展示了位集(bitset)的各种基本操作,包括设置所有位为1、重置所有位、指定位置位、按位或运算及按位取反等。这些操作对于理解bitset的工作原理及其在实际编程中的应用非常有帮助。
605

被折叠的 条评论
为什么被折叠?



