#include <iostream>

using namespace std;

#define BIT(x) (1 << x)

int main() {
enum EnumTask {
ETask1 = BIT(1),
ETask2 = BIT(2),
ETask3 = BIT(3),
ETask4 = BIT(4),
ETask5 = BIT(5),
ETask6 = BIT(6),
ETask7 = BIT(7),
ETask8 = BIT(8),
ETask9 = BIT(9),
}; // 不能无线添加枚举项, 否则可能会造成值溢出.

unsigned int task = 0;

if (task & ETask1) {
cout << "task 1 is over." << endl;
} else {
cout << "task 1 is not over." << endl;
task |= ETask1;
}

if (task & ETask1) {
cout << "task 1 is over." << endl;
task = ~(task | ETask1); // 取反
} else {
cout << "task 1 is not over." << endl;
}

if (task & ETask1) {
cout << "task 1 is over." << endl;
} else {
cout << "task 1 is not over." << endl;
task |= ETask1;
}

return EXIT_SUCCESS;
}