0%

bitset

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<bits/stdc++.h>
using namespace std;

bitset<5> b, a;
int main() {
cout << b << endl; //00000

b.set(2);
cout << b << endl;//00100

a.set(3);
cout << a << endl;//01000

b ^= a;//(00100)^(01000)
cout << b << endl;//01100

b.reset(3);//00100
cout << b << endl;

b.flip();//11011
cout << b << endl;
}