CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
using namespace std;
const int bit = 0b00000000;
const int authBit = 0b00000001;
const int adminBit = 0b00000010;
const int modBit = 0b00000100;
struct User
{
int level = ::bit;
User(const char* uname, int priviledge) {
level |= priviledge;
}
inline bool isAuthenticated() {
return level & 1;
}
inline bool isMod() {
return level & 4;
}
inline bool isAdmin() {
return level & 2;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run