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;
b.set(2); cout << b << endl;
a.set(3); cout << a << endl;
b ^= a; cout << b << endl;
b.reset(3); cout << b << endl;
b.flip(); cout << b << endl; }
|